iOS调用系统声音与振动

如何调用系统声音?【iphone 调用系统铃声与震动功能】


首先要在工程里加入Audio Toolbox framework这个库,然后在需要调用的文件里
#import <AudioToolbox/AudioToolbox.h>

最后在需要播放提示音的地方编写如下代码:

AudioServicesPlaySystemSound(1000);//新邮件消息提示

AudioServicesPlaySystemSound(kSystemSoundID_Vibrate); //震动

posted @ 2016-01-08 10:45  御剑青冥  阅读(197)  评论(0编辑  收藏  举报