In this tutorial we will access the Compass feature from PhoneGap. With this feature we can obtain the direction that the device is pointing to.
To demonstrate the use of this feature I built an application that acts as a Compass, it points to the North. This only works on the device.
The basic of iPhone application development starts with multi view, so in this tutorial we will learn to create a multi view iPhone app.
We will create a simple app which will contain 2 tabs. The first tab will also use a navigation bar.
Creating the project and tab views
Create a new project for iPhone using the template Empty Application and name it MultiView.
We will add one view controller for each tab screen: add to the project one new file for each tab using the UIViewController subclass, name them FirstViewController and SecondViewController and select the checkbox With XIB for user interface.
Draw using the Interface Builder some interface on each of the 2 screens of our multi view iPhone app.
First tab view of our multi view iPhone app