Merge pull request #10 from mrmekon/swipe_failure_detection
Add swipe states for cancelled and failed swipes.
Changed,
/// Swipe gesture has ended (finger lifted)
Ended,
+ /// Swipe was cancelled by user
+ ///
+ /// Happens when interrupted, such as when doing a single-finger swipe and
+ /// then putting down a second finger.
+ Cancelled,
+ /// Swipe failed... I dunno, ask Apple.
+ Failed,
/// Invalid state. Never sent to callbacks.
Unknown,
}
2 => SwipeState::Changed,
// NSGestureRecognizerStateEnded
3 => SwipeState::Ended,
- // NSGestureRecognizerStatePossible,
// NSGestureRecognizerStateCancelled,
+ 4 => SwipeState::Cancelled,
// NSGestureRecognizerStateFailed
+ 5 => SwipeState::Failed,
+ // NSGestureRecognizerStatePossible,
_ => SwipeState::Unknown,
};
if state != SwipeState::Unknown {