O'Reilly logo

iPhone Location Aware Apps by Example by Zeeshan Chawdhary

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action — using heading for direction in your app

We revisit the Hello Location - Location Updatesexample from Chapter 3, Using Location in your iOS Apps Core Location, and add the heading component to our application. Here is what we will achieve: Our application will check for heading information, and as we move the device left/right, we will adjust the on-screen slider to reflect the change in the direction.

  1. We begin with defining a UISlider object in our app in the Hello_LocationViewController.h file, and expose it as a property.
    @property (strong, nonatomic) IBOutlet UISlider *XSlider;
    
  2. We also declare three additional properties of type UITextField that will hold the X, Y, and Z values retrieved from the magnetometer. Of ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required