Created
March 4, 2015 14:56
-
-
Save syshen/692398f5dd5e4cc484a1 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
| [[self.viewModel.refreshCommand.executing deliverOnMainThread] subscribeNext:^(id executing) { | |
| if ([executing boolValue]) { | |
| [SVProgressHUD showWithMaskType:SVProgressHUDMaskTypeGradient]; | |
| } else { | |
| [SVProgressHUD dismiss]; | |
| } | |
| }]; | |
| @weakify(self); | |
| [[self.viewModel.refreshCommand.errors deliverOnMainThread] subscribeNext:^(NSError *error) { | |
| [SVProgressHUD dismiss]; | |
| UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil message:@"Something wrong! >_<" delegate:nil cancelButtonTitle:@"Retry" otherButtonTitles:nil]; | |
| [[alert rac_buttonClickedSignal] subscribeNext:^(id x) { | |
| @strongify(self); | |
| [self reload]; | |
| }]; | |
| [alert show]; | |
| }]; | |
| [[[self.viewModel.refreshCommand.executionSignals flatten] deliverOnMainThread] | |
| subscribeNext:^(NSArray *response) { | |
| // Create StoryViewModel here | |
| }]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment