WatchOS陀螺仪校准中断

时间:2020-06-15 18:58:59

标签: swift apple-watch gyroscope watchos

我在WatchOS应用中实现了一些摇动手势(此处为回购代码:https://github.com/ezefranca/WatchShaker),并且可以正常工作,但是现在在调试器中出现以下错误: [Gyro] Manually set gyro-interrupt-calibration to 800

这是什么意思,我该如何解决?

watchShaker(didShakeWith:)函数应在手表摇动后运行,但未运行

    override func awake(withContext context: Any?) {
        super.awake(withContext: context)
    }
        var shaker:WatchShaker = WatchShaker(shakeSensibility: .shakeSensibilityNormal, delay: 0.2)

    override func willActivate() {
        super.willActivate()

        shaker.delegate = self
        shaker.start()

        getRandomNumbers()

    }

    override func didDeactivate() {
        super.didDeactivate()
        shaker.stop()
    }

extension OneDiceController: WatchShakerDelegate {
    func watchShaker(_ watchShaker: WatchShaker, didShakeWith sensibility: ShakeSensibility) {
        self.getRandomNumbers()
    }

    func watchShaker(_ watchShaker: WatchShaker, didFailWith error: Error) {
        print(error.localizedDescription)
    }


}

1 个答案:

答案 0 :(得分:1)

嗨@noahbino 我发现了这个问题,当手表支持陀螺仪传感器时,看起来这些会发生。遵循 1.0.1 版中的 @grimxm tip here in this answer,我修复了该问题。

谢谢。

相关问题