from: http://stackoverflow.com/a/4725039

There are two seemingly similar functions that take a parameter kSystemSoundID_Vibrate:

)AudioServicesPlayAlertSound(kSystemSoundID_Vibrate);
)AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);

Both the functions vibrate the iPhone. But when you use the first function on devices that don’t support vibration, it plays a beep sound. The second function on the other hand does nothing on unsupported devices. So if you are going to vibrate the device continuously, as a alert, common sense says, use function 2.

See also "iPhone Tutorial: Better way to check capabilities of iOS devices" article.

First, add the AudioToolbox framework (AudioToolbox.framework) to your target in Build Phases.

Then, header file to import:

#import <AudioToolbox/AudioServices.h>

Making the iPhone vibrate (iPhone 振动)的更多相关文章

  1. [转]在cocos2d-x中让一个项目适配iphone、iphone retina、ipad、ipad retina四种分辨率

    http://cankeyyin.blog.163.com/blog/static/12336178320124149391202/ 原理:将iphone的hd图片给ipad用,即: 使用原iphon ...

  2. iPhone 6/iPhone 6 Plus硬件性能

    iPhone 6/iPhone 6 Plus硬件性能 评分 4 分 正 如之前传闻的,这次同时发布了两款iPhone产品,分别是4.7英寸的iPhone 6和5.5英寸的iPhone 6 Plus.苹 ...

  3. iPhone 6 & iPhone 6 Plus适配

    转载请注明出处: http://www.cnblogs.com/dokaygang128/p/4049461.html Apple 今年发布了两款新的iPhone机器,iPhone 6 和iPhone ...

  4. iOS屏幕适配 支持新手机 iPhone XR iPhone XS 超简单

    随着苹果爸爸发布了 超牛叉的iPhone iPhone X .iPhone XR.iPhone XS .iPhone XS Max.开发者的适配工作要开始了. 停,

  5. iPhone: 在 iPhone app 里使用 UIPopoverController

    更新:iOS8 版本已经不可用 为 UIPopoverController 增加类别,如下: //NSObject+UIPopover_Iphone.h #import <Foundation/ ...

  6. iPhone 6 Screen Size and Web Design Tips

    Apple updated its iPhone a bit ago making the form factor much bigger. The iPhone 6 screen size is b ...

  7. 苹果官方发布,iPhone 6 & Plus 设计素材

    苹果发布 iPhone 6 和 iPhone 6 Plus 有一段时间了,据说首日预定量达到了创纪录的1600万部,真是不可思议.苹果已经创建了一些指引,让开发者可以受益.他们已经发布了一组苹果官方的 ...

  8. 大屏iPhone的适配 +iOS 图片尺寸要求

    摘自:http://blog.ibireme.com/2014/09/16/adapted_to_iphone6/ 苹果公司官网设计介绍到:Retina显示屏的超高像素密度已超过人眼能分辨的范围.Re ...

  9. App如何适应 iPhone 5s/6/6 Plus 三种屏幕的尺寸?

    来自//www.cocoachina.com/ 初代 iPhone 2007 年,初代 iPhone 发布,屏幕的宽高是 320 x 480 像素.下文也是按照宽度,高度的顺序排列.这个分辨率一直到 ...

随机推荐

  1. Python文件遍历二种方法

    分享下有关Python文件遍历的两种方法,使用的OS模块的os.walk和os.listdir实现. 关于Python的文件遍历,大概有两种方法,一种是较为便利的os.walk(),还有一种是利用os ...

  2. [na]win7系统安装在t450s

    电脑配置 电脑型号 联想 ThinkPad T450s 笔记本电脑(最近买了个ngff口的128g的固态ssd) 操作系统 Windows 旗舰版 64位 主显卡 集成显卡 IE浏览器 版本号 8.0 ...

  3. 【Android】7.4TableLayout(表格布局)

    分类:C#.Android.VS2015: 创建日期:2016-02-11 一.简介 TableLayout也是用行和列划分单元格,但不会显示Row.Column以及Cell的边框线,其子元素有许多T ...

  4. ILRewrite && how to write a profiler

    Rewrite MSIL Code on the Fly with the .NET Framework Profiling API http://clrprofiler.codeplex.com/ ...

  5. Oracle PLSQL Demo - 11.定义包头[Define PACKAGE]

    CREATE OR REPLACE PACKAGE temp_package_demo is v_demo ); PROCEDURE p_demo_1(userid NUMBER DEFAULT v_ ...

  6. form表单提交数据编码方式和tomcat接受数据解码方式的思考

    http://blog.sina.com.cn/s/blog_95c8f1ac010198j2.html *********************************************** ...

  7. JSON数据乱码问题

    http://ifeve.com/json-code-problem/ ***************************** 背景 程序员一提到编码应该都不陌生,像gbk.utf-8.ascii ...

  8. 原声js实现addClass removeClass toggleClass效果

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  9. LeetCode: Reverse Words in a String 解题报告

    Reverse Words in a String Given an input string, reverse the string word by word. For example,Given ...

  10. Makefile学习之路——2

    让你的makefile更专业. 在上一个Makefile所在目录下通过touch命令创建一个clean文件,执行make clean,将发现make总是提示clean文件是最新的,而不是按我们期望的那 ...