How to Play a vibration on the iPhone
The iPhone operating systems provides a lot of features, the vibration is an amazing one.
It is very simple to play a vibration:
- In your view controller add the following line:
#import <AudioToolbox/AudioToolbox.h>
- Then select the project target and in the libraries add the Audiotoolbox.framework.
- Now in your source code add the following line where you want the vibration plays:
AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
That's all.
The function and the constant are both defined and implemented in the Audiotoolbox.
Gg1


