I need to make the iPhone vibrate, but I don't know how to do that in Swift. I know that in Objective-C, you just write:
import AudioToolbox
AudioServicesPlayAlertSound(kSystemSoundID_Vibrate);
But that is not working for me.
I need to make the iPhone vibrate, but I don't know how to do that in Swift. I know that in Objective-C, you just write:
import AudioToolbox
AudioServicesPlayAlertSound(kSystemSoundID_Vibrate);
But that is not working for me.
Short example:
load onto your phone and it will vibrate. You can put it in a function or IBAction as you wish.
In iOS 10 on iPhone 7 or 7 Plus, try: