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
AudioServicesPl
Other vibration types:
import AudioToolbox
AudioServicesPlaySystemSound(1519) // Actuate "Peek" feedback (weak boom)
AudioServicesPlaySystemSound(1520) // Actuate "Pop" feedback (strong boom)
AudioServicesPlaySystemSound(1521) // Actuate "Nope" feedback (series of three weak booms)
More About Vibration - http://www.mikitamanko.com/blog/2017/01/29/haptic-feedback-with-uifeedbackgenerator/