实现方法即可
摇一摇开始
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("摇一摇取消")
}