How to make iPhone vibrate using Swift?
Short example: import UIKit import AudioToolbox class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() AudioServicesPlayAlertSound(SystemSoundID(kSystemSoundID_Vibrate)) } } load onto your phone and it will vibrate. You can put it in a function or IBAction as you wish. Code Update: AudioServicesPlayAlertSoundWithCompletion(SystemSoundID(kSystemSoundID_Vibrate)) { } As apple code docs written: This function will be deprecated in a … Read more