I\'m developing a app with a gesture system, basically if I turn the iPhone to left my app will do a function, if I turn the iPhone to Right, other function, with others ges
Swift 5
class MyViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
self.becomeFirstResponder()
}
override var canBecomeFirstResponder: Bool {
get {
return true
}
}
override func motionEnded(_ motion: UIEvent.EventSubtype, with event: UIEvent?) {
if motion == .motionShake {
print("shake")
}
}
}