有没有办法通过WatchKit访问触觉反馈?

mob*_*com 7 ios watchkit

我计划创建一个Apple Watch应用程序.有没有办法通过WatchKit访问触觉反馈?

Ste*_*son 10

不,没有.以下内容来自这篇文章https://devforums.apple.com/thread/254540?tstart=15.

目前无法访问这些硬件功能,但通过WKInterfaceController呈现文本输入控制器,这将涉及麦克风.过去,我没有关于即将发布的消息的信息.

  • 请注意,仅适用于WatchKit的原始版本.请参阅后续版本的API功能的其他答案. (2认同)

hgw*_*tle 10

是.从watchOS 2.0开始,您可以使用如下play()方法方法提供触觉反馈:

WKInterfaceDevice.currentDevice().play(.success)
Run Code Online (Sandbox Code Playgroud)

  • [此处]还有完整指南(http://www.sneakycrab.com/blog/2015/6/22/haptic-feedback-with-the-taptic-engine-in-watchkit-and-watchos-2-wkinterfacedevice -and-wkhaptic),它介绍了不同的“WKHapticType”选项及其含义。 (2认同)