Sensing movement with the accelerometer input

In this recipe we will learn how to use the features of the accelerometer events of the iOS device.

Getting ready

Create a new Single View Application, and name it AccelGyroExample.

How to do it...

To begin, follow these simple steps as outlined:

  1. Select the AccelGyroExample project from the Project Navigator.
  2. Then select your project from under the TARGETS group.
  3. Select the Build Phases tab.
  4. Expand the Link Binary With Libraries disclosure triangle.
  5. Click on the + button and select the CoreMotion.framework from the list.
  6. Then click on the Add button to add the framework to your project.
    How to do it...
  7. Our next step is to ...

Get Xcode 4 Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.