Last active
July 27, 2016 07:54
-
-
Save elkraneo/9070046 to your computer and use it in GitHub Desktop.
UIAlertView with RAC signal block
This file contains 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)askListName { | |
UIAlertView *alertView = [[UIAlertView alloc]initWithTitle:@"List Name" | |
message:@"Desired Name for your new List?" | |
delegate:self | |
cancelButtonTitle:@"Cancel" | |
otherButtonTitles:@"Create", nil]; | |
[alertView setAlertViewStyle:UIAlertViewStylePlainTextInput]; | |
[alertView.rac_buttonClickedSignal subscribeNext:^(NSNumber *buttonIndex) { | |
if ([buttonIndex isEqual:@1]) { | |
[[MWGListsManager sharedInstance] addListWithName:[[alertView textFieldAtIndex:0] text]]; | |
} | |
}]; | |
[alertView show]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment