【问题标题】:How to put Apple Watch into waterproof mode?如何让 Apple Watch 进入防水模式?
【发布时间】:2017-02-02 17:50:04
【问题描述】:

我已经安排好了游泳训练。

let configuration = HKWorkoutConfiguration()
configuration.activityType = .swimming
configuration.locationType = .outdoor

do {
    workoutSession = try HKWorkoutSession(configuration: configuration) 
    workoutSession!.delegate = self
    healthStore.start(workoutSession!)
} catch let error as NSError {
    // Perform proper error handling here...
    fatalError("*** Unable to create the workout session: \(error.localizedDescription) ***")
}

但我的客户说手表不会进入防水模式,除非他手动制作。

就上下文而言,“防水锁定”是 Watch Series 2 在开始游泳锻炼时应该进入的模式。来自an Apple Support article

当您开始游泳锻炼时,Apple Watch 会自动使用 Water Lock 锁定屏幕,以避免意外点击。完成后,转动 Digital Crown 表冠以解锁屏幕并清除 Apple Watch 上的水。您会听到声音,并且可能会感觉到手腕上有水。

此功能似乎不适用于我的应用程序。

我只有一个系列 0 可以测试,所以我无法确认我的代码在防水锁方面发生了什么。

我是否遗漏了一些东西来让锻炼迫使手表进入防水模式?

【问题讨论】:

  • “防水模式”是什么意思?您是否正在考虑一些特定的功能?否则 Apple 的技术说明“关于 Apple Watch 防水性”:support.apple.com/en-ca/HT205000
  • 感谢您提供该链接。我正在尝试使“自动”功能正常工作:“当您开始游泳锻炼时,Apple Watch 会自动使用 Water Lock 锁定屏幕以避免意外点击。完成后,转动 Digital Crown 以解锁屏幕并清除 Apple Watch 上的水。您会听到声音,并且可能会感觉到手腕上有水。”
  • 显然水锁没有用我的代码激活。

标签: swift apple-watch


【解决方案1】:

自 watchOS 4 起可用: https://developer.apple.com/documentation/watchkit/wkextension/2868458-enablewaterlock

// Only an application which is in an active workout or location session and is foreground is allowed to enable water lock @available(watchOS 4.0, *) open func enableWaterLock()

开始游泳/水上锻炼时,请致电WKExtension.shared().enableWaterLock()

【讨论】:

    【解决方案2】:

    目前没有“防水模式”。我的客户认为有。

    原生 Apple 锻炼应用程序有一个按钮,用于锁定手表并忽略交互,直到旋转数字表冠。这目前无法在第三方应用中重现。

    我找到的解决方案是禁用手表应用程序上的所有按钮。这样,在水中时按钮就不会被意外敲击。用户必须强制触摸手表才能重新启用按钮。

    【讨论】:

      猜你喜欢
      • 2016-05-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多