vsanthanam / VSAlert

An drop-in replacement for UIAlertController with more power and better looks.
https://www.vsalert.io
MIT License
48 stars 15 forks source link

Haptic Feedback Support? #17

Closed docash59 closed 6 years ago

docash59 commented 6 years ago

Will there be support for adding/enabling haptic feedback? Like for when you tap on one of the action buttons?

vsanthanam commented 6 years ago

Unlikely, for a number of reasons:

1) This library is designed to mimic UIAlertController and extend it, not alter it. UIAlertController explicitly does not implement such feedback, instead passing that responsibility to it's per-instance implementation.

2) Haptic feedback should be used sparingly in iOS, and not at all on certain kinds of hardware. It should really be set up in the action's block on a case by case basic. Generic / global implementations are bound to create experience issues in some cases.

I've written a detailed blog post on how / when to use haptic feedback in iOS. If you're interested, you can read it here:

https://www.vsanthanam.com/writing/2017/10/24/haptic-feedback-done-correctly

You can pretty easily add haptic feedback using those APIs as needed.