June 2011
Intermediate to advanced
590 pages
19h 31m
English
Each time the accelerometer sends an update, the center of the view changes to reflect the orientation of the device. However, because the accelerometer’s updateInterval is constant and the device’s movement is variable, the center of the view jumps around instead of moving in calm, peaceful, smooth manner. To get smooth movement, you need “smoothed” data. To smooth accelerometer data, you apply a low-pass filter.
In HypnosisViewController.m, add the following lines of code to filter the accelerometer data:
- (void)accelerometer:(UIAccelerometer *)meter didAccelerate:(UIAcceleration *)accel { HypnosisView ...Read now
Unlock full access