How to make my iphone vibrate twice when I click on a button?
问题 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 :/. 回答1: #import <AudioToolbox/AudioServices.h> AudioServicesPlayAlertSound(UInt32(kSystemSoundID_Vibrate)) This is the swift function...See this article for detailed description. 回答2: Update for iOS 10 With iOS 10, there are a few new ways to do this with minimal code.