How to get accelerometer data in IOS?

前端 未结 6 2079
被撕碎了的回忆
被撕碎了的回忆 2021-02-08 09:58

I am using the UIAccelerotmeterDelegate method accelerometer:didAccelerate: but recently that method has been deprecated in iOS 5.0. So what is the alternative way

6条回答
  •  一整个雨季
    2021-02-08 10:11

    It seems that UIAccelerometer and UIAccelerometerDelegate were replaced by the CoreMotion framework.

    You can find the answer here:

    Why is accelerometer:didAccelerate: deprecated in IOS5?

    I Hope it helps.

提交回复
热议问题