Cartman. Posted June 26, 2014 Report Posted June 26, 2014 With this iOS SDK code snippet, you will learn how to cause the iPhone to vibrate with the AudioToolbox framework and a single line of code.Creating a vibration is simple as pie - simpler in fact. It just requires one line of code; two if you add the import line. But as simple as a one-liner is it is better to make it into a function. So here is the one liner, followed by the function. Cheers/ NOTE: You need to import the AudioToolbox for access to the vibrate#import <AudioToolbox/AudioToolbox.h>*// The one-liner:AudioServicesPlaySystemSound (kSystemSoundID_Vibrate);*// The function:- (void)vibrate { AudioServicesPlaySystemSound (kSystemSoundID_Vibrate);}*// The call from within another method in the same class:- (void)myMethod { [self vibrate];} Quote