Swift에서 모션 관리자를 사용하려고하지만 업데이트 블록 내의 로그가 결코 인쇄되지 않습니다.Motion Manager가 Swift에서 작동하지 않습니다.
var motionManager: CMMotionManager = CMMotionManager()
motionManager.accelerometerUpdateInterval = 0.01
println(motionManager.deviceMotionAvailable) // print true
println(motionManager.deviceMotionActive) // print false
motionManager.startDeviceMotionUpdatesToQueue(NSOperationQueue.currentQueue(), withHandler:{
deviceManager, error in
println("Test") // no print
})
println(motionManager.deviceMotionActive) // print false
내 Objective-C 구현이 정상적으로 작동합니다. 누군가 내 업데이트 블록이 호출되지 않는 이유를 알고 있습니까?