How to Add and Set Up the EventPageController in the MainStoryboard in Your iOS App
How to Create an Outlet for the Map Controller in Your iOS App
How to Use the Library Pane for iOS App Development

Track Location and Motion with iOS Location Services

You can develop an iOS 6 app that can determine the device’s current location or even be notified when that location changes, using iOS location services. As people move, it may make sense for your app to tailor itself to where the user is, moment by moment.

Many iPad and iPhone apps use location information to tell you where the nearest coffeehouse is or even where your friends are.

When you know the user’s location, you can even put it on a map, along with other places he or she may be interested in.

All iOS devices contain an accelerometer with three-dimensional data — a component that detects changes in movement. The accelerometer measures change along one of the primary axes in three-dimensional space. An app can, for example, know when the user has turned the device from vertical to horizontal orientation, and it can change the orientation from Portrait to Landscape if doing so makes for a better user experience.

Newer devices add a gyroscope and — together with the accelerometer — improve the ability of the device to measure the direction you are moving it in space.

You can also determine other types of motion such as a sudden start or stop in movement (think of a car accident or a fall) or the user shaking the device back and forth. It makes some way-cool features easy to implement — for example, the Etch A Sketch metaphor of shaking the device to undo an operation.

You can even control a game by moving the iPhone or iPad like a controller — such as the Need for Speed Shift game for the iPad (Electronic Arts), in which you drive the car by using the device like a steering wheel.

  • Add a Comment
  • Print
  • Share
blog comments powered by Disqus
How to Customize Xcode for Your iPad App
How to Customize Your iOS App Table View for the iPad
How to Add the Weather View Controller to Your iOS App
How to Add a Button to Your iOS App
How to Set Up a WeatherController in the Main_iPad.storyboard file for Your iOS App
Advertisement

Inside Dummies.com