//
// MotionShake.swift
//
override func canBecomeFirstResponder() -> Bool {
return true
}
override func motionBegan(motion: UIEventSubtype, withEvent event: UIEvent?) {
if event!.type == UIEventType.Motion && event!.subtype == UIEventSubtype.MotionShake {
// シェイク動作始まり時の処理
// shake`s motion is beginning
}
}
override func motionEnded(motion: UIEventSubtype, withEvent event: UIEvent?) {
if event!.type == UIEventType.Motion && event!.subtype == UIEventSubtype.MotionShake {
// シェイク動作終了時の処理
// shake`s motion is finished
}
}