Vibrate the iPhone 6S manually, how to peek and pop?

How can I manually trigger a single click vibration, similar to those that occur when using peek & pop keyboard shortcuts or applications?

+5
source share
2 answers

It seems these guys have found a way to do this for iOS 9 for phones with the Taptic Engine (including the iPhone 6S). http://unifiedsense.com/development/using-taptic-engine-on-ios.html I'm not sure if this applies to iOS 8 or other phones. They essentially retrieved the Taptic Engine interface from the UIDevice and called actuateFeedback with an integer matching Peek or Pop.

Unfortunately, these applications are likely to be rejected by the App Store, if that is your intention.

+1
source

This method is easy to implement and it works very well (I tried it myself)

 import AudioToolbox AudioServicesPlaySystemSound(1519) // Peek feedback AudioServicesPlaySystemSound(1520) // Pop feedback AudioServicesPlaySystemSound(1521) // Three pulses feedback 

Hope this helps! :)

+15
source

Source: https://habr.com/ru/post/1234835/


All Articles