watchOS2 - CMSensorRecorder

吃可爱长大的小学妹 提交于 2019-12-06 00:26:46
Marcus Vinicius Kuquert

Maybe you can try to

func startMovementDetection(){
    self.startDate = NSDate()
    self.cmSensorRecorder?.recordAccelerometerFor(self.recorderDuration)
}

And have a look at Swift watchOS 2 - CMSensorDataList

the CMSensorRecorder also have a bug: you should wait for 3 to 5 minutes to restart your Recorder, otherwise the List will always return nil.(you can watch the Apple's video for more details.)

I had the same problem, found the solution in this post:

https://forums.developer.apple.com/thread/15470

"It apparently does not like the charger to be plugged in on the watch when starting recroding"

Just need to disconnect the device from its charger. Makes sense, but of course not documented officially anywhere...

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!