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

Posted by at March 7, 2011
Filed in category: iphone, Mac OS X, and tagged with: , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

*


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <font color="" face="" size=""> <span style="">

Statistical data collected by Statpress SEOlution (blogcraft).