使用 watchkit 的 playHaptic 的正确语法

Proper Syntax for playHaptic with watchkit

Objective-C问题

嘿,我需要帮助弄清楚如何将 playHaptic 与 watchkit 一起使用,因为文档有点混乱。我有

        - (void)playHaptic:(WKHapticType)WKHapticTypeFailure

我一直收到错误

Use of undeclared identifier 'playHaptic'

这是文档页面:link

感谢任何帮助!谢谢,蔡斯

要播放触觉反馈,您需要执行以下操作:

[[WKInterfaceDevice currentDevice] playHaptic: WKHapticTypeNotification];

您可以找到不同类型的触感 here