whenRecognitionStateIsAnyOf specification
This is the engineering specification for the MotionObservable
operator whenRecognitionStateIsAnyOf
that
operates on GestureRecognizer value types.
Overview
Only invoke next when the gesture recognizer’s state matches the provided states.
Example usage:
gestureSource(gesture).whenRecognitionStateIsAnyOf([began, changed])
MVP
Expose whenRecognitionStateIsAnyOf 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 whenRecognitionStateIsAnyOf(states: [UIGestureRecognizerState]) -> MotionObservable<T> {
return _filter { value in
return states.contains(value.state)
}
}