April 2010
Beginner to intermediate
480 pages
10h 9m
English
One of the flashiest features of the iPhone is the accelerometer. The accelerometer detects the device’s real-world orientation by tracking the force of the earth’s gravity on its X, Y, and Z axes. You can also use the accelerometer data to detect changes in the device’s velocity.
In this chapter, you are going to use the accelerometer to skew the center of the HypnosisView according to orientation: when the user tilts the phone, the center will slide in the direction of the tilt, as shown in (Figure 8.1).
Figure 8.1. HypnosisView

To receive accelerometer data, your application needs to give ...
Read now
Unlock full access