O'Reilly logo

Xcode 4 Cookbook by Steven F. Daniel

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

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 ...

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