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:




That's all.

The function and the constant are both defined and implemented in the Audiotoolbox.