import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
}
override func motionBegan(_ motion: UIEvent.EventSubtype, with event: UIEvent?) {
print("摇一摇开始")
}
override func motionEnded(_ motion: UIEvent.EventSubtype, with event: UIEvent?) {
print("摇一摇结束")
}
override func motionCancelled(_ motion: UIEvent.EventSubtype, with event: UIEvent?) {
print("摇一摇取消")
}
}