以编程方式使iPhone振动 [英] Programmatically make the iPhone vibrate

查看:123
本文介绍了以编程方式使iPhone振动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:

使iPhone振动

如何以编程方式让iPhone振动?

How can you programmatically make the iPhone vibrate?

任何想法或教程链接都表示赞赏。

Any ideas, or tutorial links appreciated.

推荐答案

你可以使用

AudioServicesPlaySystemSound(kSystemSoundID_Vibrate); 

请注意,您需要添加AudioToolbox框架并导入以下头文件:

Note that you need to add the AudioToolbox framework and import the following header file:

#import <AudioToolbox/AudioServices.h>

这篇关于以编程方式使iPhone振动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆