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
Swift 4.2, 5.0
if #available(iOS 10.0, *) { UIImpactFeedbackGenerator(style: .light).impactOccurred() }
You can also choose other styles like
style: .heavy style: .medium //Note: soft and rigid available in only iOS 13.0 style: .soft style: .rigid