iphone-vibrate

How to make my iphone vibrate twice when I click on a button?

折月煮酒 提交于 2019-12-04 13:31:51
I search to make vibrate twice my iphone when I click on a button (like a sms alert vibration) With AudioServicesPlayAlertSound(SystemSoundID(kSystemSoundID_Vibrate)) I obtain just one normal vibration but I want two shorts :/. vijeesh #import <AudioToolbox/AudioServices.h> AudioServicesPlayAlertSound(UInt32(kSystemSoundID_Vibrate)) This is the swift function...See this article for detailed description. Update for iOS 10 With iOS 10, there are a few new ways to do this with minimal code. Method 1 - UIImpactFeedbackGenerator : let feedbackGenerator = UIImpactFeedbackGenerator(style: .heavy)

Intensity of custom iPhone vibration

只谈情不闲聊 提交于 2019-12-04 13:27:30
问题 This is a question related to Are there APIs for custom vibrations in iOS?. I am able to create custom vibration patterns, but have no control over the intensity. This is copied over from Kevin Cao's answer that enables custom vibration patterns: NSMutableDictionary* dict = [NSMutableDictionary dictionary]; NSMutableArray* arr = [NSMutableArray array ]; [arr addObject:[NSNumber numberWithBool:YES]]; //vibrate for 2000ms [arr addObject:[NSNumber numberWithInt:2000]]; [arr addObject:[NSNumber

Vibrate iPhone 6S manually like peek and pop?

自古美人都是妖i 提交于 2019-12-03 07:40:31
How can I manually trigger a single click-like vibration like the ones that happen when using peek&pop, or application shortcuts? It seems that these guys have found a way to do it for iOS 9 for phones with Taptic Engine (including the iPhone 6S). http://unifiedsense.com/development/using-taptic-engine-on-ios.html I'm not sure if it applies to iOS 8 or any other phones. They've essentially retrieved the Taptic Engine interface from UIDevice and called actuateFeedback with an integer corresponding to Peek or Pop. Unfortunately these apps would likely be rejected by the App Store, if that's your

Programmatically make the iPhone vibrate [duplicate]

大憨熊 提交于 2019-12-03 03:37:52
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Making the iPhone vibrate How can you programmatically make the iPhone vibrate? Any ideas, or tutorial links appreciated. 回答1: You can use AudioServicesPlaySystemSound(kSystemSoundID_Vibrate); Note that you need to add the AudioToolbox framework and import the following header file: #import <AudioToolbox/AudioServices.h> 回答2: To clarify the add(ing) the AudioToolbox framework portion of this answer: click the

Are there APIs for custom vibrations in iOS?

北慕城南 提交于 2019-11-26 11:33:31
Starting in iOS 5, users are able to create custom vibration patterns for alerts and rings. The following screenshot shows the UI for creating one (Contacts app in iOS 6): I've been searching around, including the documentation, and I cannot find any public APIs that expose the creation or playback of custom vibrations. The closest thing is to use the AudioToolbox framework to play a short, constant vibration: AudioServicesPlaySystemSound(kSystemSoundID_Vibrate); Does anyone know if there are APIs for custom vibrations? It doesn't necessarily have to be public APIs. I'm curious to know what

Are there APIs for custom vibrations in iOS?

醉酒当歌 提交于 2019-11-26 02:27:45
问题 Starting in iOS 5, users are able to create custom vibration patterns for alerts and rings. The following screenshot shows the UI for creating one (Contacts app in iOS 6): I\'ve been searching around, including the documentation, and I cannot find any public APIs that expose the creation or playback of custom vibrations. The closest thing is to use the AudioToolbox framework to play a short, constant vibration: AudioServicesPlaySystemSound(kSystemSoundID_Vibrate); Does anyone know if there