Skip to content

Instantly share code, notes, and snippets.

@ashfurrow
Last active December 17, 2015 14:08
Show Gist options
  • Save ashfurrow/5621841 to your computer and use it in GitHub Desktop.
Save ashfurrow/5621841 to your computer and use it in GitHub Desktop.
ReactiveCocoa RACSubject Example
self.gestureRecognizerIsRunningSubject = [RACSubject subject];
self.gestureRecognizerValueSubject = [RACSubject subject];
RAC(self.someView.frame) = [self.gestureRecognizerValueSubject map:^id(NSValue *value) {
CGPoint location = [value CGPointValue];
CGFloat size = 100.0f;
return [NSValue valueWithCGRect:CGRectMake(location.x - size/2.0f, location.y - size/2.0f, size, size)];
}];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment