whenRecognitionStateIs specification
This is the engineering specification for the MotionObservable
operator whenRecognitionStateIs
that
operates on GestureRecognizer value types.
Overview
Only invoke next when the gesture recognizer’s state matches the provided states.
Example usage:
gestureSource(gesture).whenRecognitionStateIs(began)
MVP
Expose whenRecognitionStateIs API
Should delegate to _filter
. This API should only be available for streams emitting
GestureRecognizer values.
The output of this operator should be a GestureRecognizer.
extension MotionObservable where T: GestureRecognizer {
public func whenRecognitionStateIs(state: GestureRecognizerState) -> MotionObservable<T> {
return _filter { value in
return value.state == state
}
}