Skip to content

Instantly share code, notes, and snippets.

@elkraneo
Last active July 27, 2016 07:54
Show Gist options
  • Save elkraneo/9070046 to your computer and use it in GitHub Desktop.
Save elkraneo/9070046 to your computer and use it in GitHub Desktop.
UIAlertView with RAC signal block
- (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