The release of IOS5 has this core function listed as deprecated. Does anyone know what will replace it? I'm assuming that apple is not going to remove the accelerometer from iPhone 5.
相关问题
- what is the difference between bounded and unbound
- didSelectViewController method not being called (w
- ios5 background management different from ios4?
- CoreBluetooth - Can connectPeripheral be called mu
- reloadData doesn't work
相关文章
- Handling ffmpeg library interface change when upgr
- Popover segue to static cell UITableView causes co
- Creating UIImage from CIImage
- UIAlertViewStylePlainTextInput return key delegate
- AVCaptureDeviceOutput not calling delegate method
- How to call an action when UISwitch changes state?
- Making any tweet favourite through iOS 5 twitter A
- Unable to pass NSManagedObjectContext to my view c
I did not yet use iOS 5, but already in 4.x UIAccelerometer and UIAccelerometerDelegate were replaced by the CoreMotion framework. It is more sophisticated, takes gyroscope signals into account and performs a sensor fusion i.e. does calibrating stuff like bias calculation for you.
Basically the CMDeviceMotionHandler block callback is now the equivalent. It is called every deviceMotionUpdateInterval seconds or you can go with your own timer loop and pull the data. It is pretty straightforward and easy to use. Look at Simple iPhone motion detect and follow the three links to the SDK docs.
There are three things you have to bear in mind: