Developer use of “Taptic Engine” on Apple Watch

2019-02-16 11:03发布

问题:

According to Apple's press info about the release of iOS 8.2 and Xcode 6.2 found here, they mention developers being able to use the new technologies presented with the Apple Watch:

With the iOS 8.2 beta SDK, developers can now start using WatchKit to create breakthrough new apps, Glances and actionable notifications designed for the innovative Apple Watch interface and work with new technologies such as Force Touch, Digital Crown and Taptic Engine.

After combing through the WatchKit framework documentation, I have found no mention of using the Taptic Engine. Is there a way for developers to use it? Perhaps they haven't implemented that yet and it may come in a later update for iOS 8.2, but I don't think this is the case. What am I missing?

回答1:

Currently in watchOS 2 beta 1, you can now use the WKInterfaceDevice.currentDevice().playHaptic(.Click) API to play haptic feedback on your Watch App.

You can find a full guide here on how to use this new API: http://www.sneakycrab.com/blog/2015/6/22/haptic-feedback-with-the-taptic-engine-in-watchkit-and-watchos-2-wkinterfacedevice-and-wkhaptic



回答2:

Direct access to the Taptic Engine is not possible with the WatchKit framework. Taptic feedback would come as a result of your app (for example) receiving a push notification.

Of course, if you'd like this feature, please file a request for it at https://bugreport.apple.com.