Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS 10 iPhone 6S Play Haptic feedback or vibrate using taptic engine

Tags:

ios

iphone

Iphone6s has taptic engine or not, can I use a public API called UIFeedbackGenerator to access it?

like image 385
Noha Mohamed Avatar asked Nov 09 '16 08:11

Noha Mohamed


People also ask

Does iPhone 6s have haptic engine?

Introduction. Follow this guide to replace the Taptic Engine in your iPhone 6s. The Taptic Engine is the iPhone's vibrating and haptic feedback motor. If your phone isn't vibrating or produces a rattling sound when it does, replacing the Taptic Engine can remedy your issues.

How do you get haptic feedback on iPhone 6?

Turn haptic feedback off or on On supported models, go to Settings > Sounds & Haptics. Turn System Haptics off or on.

What is the difference between haptic and Taptic?

Apple's Haptic Touch technology is similar to 3D Touch but it doesn't rely on pressure. Instead, Haptic Touch kicks in when a user long-presses the screen, offering a small vibration as acknowledgement following the press; haptic feedback, hence the Haptic Touch name.


1 Answers

Haptic feedback engine have been introduced in iPhone7/7+ and you can use it via UIFeedbackGenerator, here's an example:

let generator = UIImpactFeedbackGenerator(style: .heavy)
generator.prepare()

generator.impactOccurred()

As for iPhone 6S/6S I've found kind of fallback, please try it and describe the experience if you do have the device:

import AudioToolbox


AudioServicesPlaySystemSound(1519) // Actuate `Peek` feedback (weak boom)
AudioServicesPlaySystemSound(1520) // Actuate `Pop` feedback (strong boom)
AudioServicesPlaySystemSound(1521) // Actuate `Nope` feedback (series of three weak booms)

I've tried to summarize everything I found with regards to the Haptic feedback here: http://www.mikitamanko.com/blog/2017/01/29/haptic-feedback-with-uifeedbackgenerator/

like image 140
Mikita Manko Avatar answered Sep 22 '22 21:09

Mikita Manko