Book Image

iPhone Location Aware Apps by Example - Beginner's Guide

By : Zeeshan Chawdhary
Book Image

iPhone Location Aware Apps by Example - Beginner's Guide

By: Zeeshan Chawdhary

Overview of this book

<p>From weather apps which give you a forecast based on your current location to fitness apps which track your speed and distance travelled. From Google Maps to Foursquare. Increasing mobility and social networking has made location awareness an integral aspect of modern iPhone applications. <br /><br />This book will teach you everything you need to know about building iPhone location aware apps, from simple Google maps to complex region monitoring and augmented reality. Build five real world location aware apps and get a taste of HTML5-based mobile app development.<br /><br />The book begins by explaining behind-the-scenes working of location-based systems, including GPS. Explore in depth iOS Core Location and the MapKit Framework, using examples depicting each capability of the respective frameworks. Having learnt about location and maps, you will build five location-based apps using the APIs and SDKs publicly available. The book has everything for a beginner as well as advanced users, with chapters devoted to advanced topics such as push notifications, geo fencing and augmented reality.</p>
Table of Contents (17 chapters)
iPhone Location Aware Apps by Example
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface

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. 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. 2. We also declare three additional properties of type UITextField that will hold the X, Y, and Z values retrieved from the magnetometer. Of this, our interest lies in the X value. We will use this to move the slider, as we move right /left.

    @property (strong, nonatomic) IBOutlet UITextField *XVALUE;
    @property (strong, nonatomic) IBOutlet UITextField *YVALUE;
    @property (strong, nonatomic)...