xcode - How do you make a haptic play on the apple watch using Objective-C code -


how make haptic play on apple watch when press button using objective-c , xcode.

objective-c:

[[wkinterfacedevice currentdevice] playhaptic:wkhaptictype.success] 

swift:

wkinterfacedevice.currentdevice().playhaptic(.success) 

types of haptic can play:

wkhaptictype.notification, wkhaptictype.directionup, wkhaptictype.directiondown, wkhaptictype.success, wkhaptictype.failure, wkhaptictype.retry, wkhaptictype.start, wkhaptictype.stop, wkhaptictype.click  

documentation: https://developer.apple.com/library/prerelease/watchos/documentation/watchkit/reference/wkinterfacedevice_class/index.html#//apple_ref/occ/cl/wkinterfacedevice


Comments