Last active
December 17, 2015 14:09
-
-
Save ashfurrow/5621995 to your computer and use it in GitHub Desktop.
ReactiveCocoa RACSubject Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(void)gestureRecognizerReceivedTouch:(UIPanGestureRecognizer *)recognizer { | |
if (recognizer.state == UIGestureRecognizerStateBegan) { | |
[self.gestureRecognizerIsRunningSubject sendNext:@(YES)]; | |
} | |
else if (recognizer.state == UIGestureRecognizerStateChanged) { | |
[self.gestureRecognizerValueSubject sendNext:[NSValue valueWithCGPoint:[recognizer locationInView:self.view]]]; | |
} | |
else if (recognizer.state == UIGestureRecognizerStateEnded) { | |
[self.gestureRecognizerIsRunningSubject sendNext:@(NO)]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment