Programmatically make the iPhone vibrate [duplicate]
-
21-09-2019 - |
Question
Possible Duplicate:
Making the iPhone vibrate
How can you programmatically make the iPhone vibrate?
Any ideas, or tutorial links appreciated.
Solution
You can use
AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
Note that you need to add the AudioToolbox framework and import the following header file:
#import <AudioToolbox/AudioServices.h>
OTHER TIPS
To clarify the add(ing) the AudioToolbox framework portion of this answer:
- click the project from Project Navigator
- click the target from the left-hand navigator
- click Build Phases section at the top
- expand the Link Binary With Libraries section
- click little + (plus) sign
- type
AudioToolbox.framework
- click Add
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow