Making the iPhone vibrate (iPhone 振动)
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 振动)的更多相关文章
- [转]在cocos2d-x中让一个项目适配iphone、iphone retina、ipad、ipad retina四种分辨率
http://cankeyyin.blog.163.com/blog/static/12336178320124149391202/ 原理:将iphone的hd图片给ipad用,即: 使用原iphon ...
- iPhone 6/iPhone 6 Plus硬件性能
iPhone 6/iPhone 6 Plus硬件性能 评分 4 分 正 如之前传闻的,这次同时发布了两款iPhone产品,分别是4.7英寸的iPhone 6和5.5英寸的iPhone 6 Plus.苹 ...
- iPhone 6 & iPhone 6 Plus适配
转载请注明出处: http://www.cnblogs.com/dokaygang128/p/4049461.html Apple 今年发布了两款新的iPhone机器,iPhone 6 和iPhone ...
- iOS屏幕适配 支持新手机 iPhone XR iPhone XS 超简单
随着苹果爸爸发布了 超牛叉的iPhone iPhone X .iPhone XR.iPhone XS .iPhone XS Max.开发者的适配工作要开始了. 停,
- iPhone: 在 iPhone app 里使用 UIPopoverController
更新:iOS8 版本已经不可用 为 UIPopoverController 增加类别,如下: //NSObject+UIPopover_Iphone.h #import <Foundation/ ...
- 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 ...
- 苹果官方发布,iPhone 6 & Plus 设计素材
苹果发布 iPhone 6 和 iPhone 6 Plus 有一段时间了,据说首日预定量达到了创纪录的1600万部,真是不可思议.苹果已经创建了一些指引,让开发者可以受益.他们已经发布了一组苹果官方的 ...
- 大屏iPhone的适配 +iOS 图片尺寸要求
摘自:http://blog.ibireme.com/2014/09/16/adapted_to_iphone6/ 苹果公司官网设计介绍到:Retina显示屏的超高像素密度已超过人眼能分辨的范围.Re ...
- App如何适应 iPhone 5s/6/6 Plus 三种屏幕的尺寸?
来自//www.cocoachina.com/ 初代 iPhone 2007 年,初代 iPhone 发布,屏幕的宽高是 320 x 480 像素.下文也是按照宽度,高度的顺序排列.这个分辨率一直到 ...
随机推荐
- Python中的break和continue的使用方法
一.continue的使用方法(结束当前的循序,进行下一个数的循环) # *************************************************************** ...
- [k8s]elk架构设计-k8s集群里搭建
elasticsearch和mysql的对比 https://blog.csdn.net/qq_21383435/article/details/79323383 Mapping ~ Schema m ...
- 【Android】19.1 SharedPreferences类
分类:C#.Android.VS2015: 创建日期:2016-03-05 一.简介 SharedPreferences:简单共享存储首选项.实际上就是用加密的内部文件保存所有页面都能访问的一系列“n ...
- python常用的十进制、16进制、字符串、字节串之间的转换
进行协议解析时,总是会遇到各种各样的数据转换的问题,从二进制到十进制,从字节串到整数等等 废话不多上,直接上例子 整数之间的进制转换: 10进制转16进制: hex(16) ==> 0x10 ...
- cocos2d-x 3.0点击响应
迄今为止,发现cocos2d-x 3.0最让人惊艳的地方就是更改了点击事件机制.(ps:迄今只看了点击事件这块,捂嘴笑~~~) cocos2d-x 2.0 只有CCLayer有点击事件处理,需要注册, ...
- Map Class Example
Here's a quick look at how to use the Scala Map class, with a colllection of Map class examples. The ...
- Servlet/Filter发布后与其他页面的相对路径
1.Servlet 3个文件 E:\web.workspace\mldndemo\WebContent\ch14\regist.html E:\web.workspace\mldndemo\WebCo ...
- LeetCode: Count and Say 解题报告
Count and Say The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, ...
- LocationActivity
package com.baidu.location.demo; import com.baidu.baidulocationdemo.R;import com.baidu.location.BDLo ...
- php结合msf反弹内网shell
感谢: perl6大佬分享的姿势. MSF: msf > use payload/php/bind_phpmsf exploit(handler) > set PAYLOAD payloa ...