@@ -24,17 +24,17 @@ class ReactiveGestureReactor: GestureReactor {
24
24
// Passing on the UIGesture at this point is dodgy as it's a reference
25
25
// It's state will change and render our filter useless.
26
26
// We therefore keep just the state in our observable buffers [.Began,.Began,.Ended]
27
- let rotateGuesturesStartedEnded = rotateVariable. asObservable ( ) . filter { gesture in gesture? . state == . Began || gesture? . state == . Ended} . flatMap { ( gesture) -> Observable < UIGestureRecognizerState > in
27
+ let rotateGesturesStartedEnded = rotateVariable. asObservable ( ) . filter { gesture in gesture? . state == . Began || gesture? . state == . Ended} . flatMap { ( gesture) -> Observable < UIGestureRecognizerState > in
28
28
return Observable . just ( gesture!. state)
29
29
}
30
30
31
- let panGuesturesStartedEnded = panVariable. asObservable ( ) . filter { gesture in gesture? . state == . Began || gesture? . state == . Ended} . flatMap { ( gesture) -> Observable < UIGestureRecognizerState > in
31
+ let panGesturesStartedEnded = panVariable. asObservable ( ) . filter { gesture in gesture? . state == . Began || gesture? . state == . Ended} . flatMap { ( gesture) -> Observable < UIGestureRecognizerState > in
32
32
return Observable . just ( gesture!. state)
33
33
}
34
34
35
35
// Combine our latest .Began and .Ended from both Pan and Rotate.
36
36
// If they are the same then return the same state. If not then return a Failed.
37
- let combineStartEndGuestures = Observable . combineLatest ( panGuesturesStartedEnded , rotateGuesturesStartedEnded ) { ( panState, rotateState) -> Observable < UIGestureRecognizerState > in
37
+ let combineStartEndGestures = Observable . combineLatest ( panGesturesStartedEnded , rotateGesturesStartedEnded ) { ( panState, rotateState) -> Observable < UIGestureRecognizerState > in
38
38
39
39
var state = UIGestureRecognizerState . Failed //a bit of misuse ;)
40
40
@@ -48,12 +48,12 @@ class ReactiveGestureReactor: GestureReactor {
48
48
49
49
50
50
// condition: when both pan and rotate has begun
51
- let bothGesturesStarted = combineStartEndGuestures . switchLatest ( ) . filter { ( state) -> Bool in
51
+ let bothGesturesStarted = combineStartEndGestures . switchLatest ( ) . filter { ( state) -> Bool in
52
52
state == . Began
53
53
}
54
54
55
55
// condition: when both pan and rotate has Ended
56
- let bothGesturesEnded = combineStartEndGuestures . switchLatest ( ) . filter { ( state) -> Bool in
56
+ let bothGesturesEnded = combineStartEndGestures . switchLatest ( ) . filter { ( state) -> Bool in
57
57
state == . Ended
58
58
}
59
59
0 commit comments