One of the flashiest features of iOS 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 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 the device’s 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 HypnoTime, tilted
Setting Up the Accelerometer
To receive accelerometer data, your application needs to get ...