how to make iphone shake

来源:互联网 发布:新开的超市怎录入数据 编辑:程序博客网 时间:2024/06/10 20:03

1.Add the AudioToolbox framework to your target.


2. In the file you intend to trigger a vibration, import the AudioToolbox header file:
#import <AudioToolbox/AudioToolbox.h>


3. Finally, call the following line to make the device vibrate:
AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);




 needed to change an iphone setting .


 For sounds , had vibrate turned off. 


 change vibrate to ON under sounds