Created
June 25, 2013 23:41
-
-
Save bvanderveen/5863493 to your computer and use it in GitHub Desktop.
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
// view model | |
self.figureOutWhatToShowNext = [RACCommand commandWithCanExecuteSignal:self.okayToShowNextThing]; | |
self.nextVM = [[self.figureOutWhatToShowNext addSignalBlock:^ RACSignal *(id value) { | |
return [self.model.figureItOut map:id (id x) { return x.boolValue ? [[OkayVM alloc] init] : [[NotOkayVM alloc] init] }]; | |
] flatten]; | |
// view | |
someButton.rac_command = vm.figureOutWhatToShowNext; | |
[vm.nextVM subscribeNext:^ (id vm) { | |
UIViewController *vc = makeVCFromVMSomehow(vm); | |
[self.navigationController presentViewController:vc animated:YES]; | |
}]; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment