Member-only story
How to add Haptic feedback using Taptic Engine in iOS Swift?
The Taptic Engine is Apple’s implementation of haptic user interface feedback. This is available from iPhone 7 and above. Let’s understand more about it. Taptic Engine is available from iphone 6s, but iphone 7 has a better version of it.
The iPhone has previously used the linear actuator for vibrations — this has shifted over to the Taptic Engine in the iPhone 6s and above. Apple applies its Taptic Engine to mimic a home button press, relay system notifications, and reinforce audio alerts. But the feedback from the system feels natural, and in sync with what is being presented on screen.
How to do a basic vibration on iOS devices?
AudioToolbox.AudioServices helps us to vibrate the phone using the following code. This works on all devices.
AudioServicesPlaySystemSound(SystemSoundID(kSystemSoundID_Vibrate))
Here is a LIST OF SOUND_IDs available in iOS devices.
Iphone 6s and above comes with taptic engine along with the introduction of 3D touch. iPhone 7 and above has a newer version of taptic engine which is better compared to the one…