-
-
Save drouillard/fc43316a5030d54dfe55 to your computer and use it in GitHub Desktop.
UI Action Sheet with blocks that implements a correctly looking 'No' button. Meaning not at top of ActionSheet.
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
//Uses UIActionSheet+blocks | |
UIActionSheet *as = [[UIActionSheet alloc] initWithTitle:@"Save before leaving?" | |
delegate:nil | |
cancelButtonTitle:NSLocalizedString(@"CancelBtnText", nil) | |
destructiveButtonTitle:nil | |
otherButtonTitles:@"Yes",@"No",nil ]; | |
as.destructiveButtonIndex = 1; | |
as.tapBlock = ^(UIActionSheet *actionSheet, NSInteger buttonIndex){ | |
NSLog(@"Chose %@", [actionSheet buttonTitleAtIndex:buttonIndex]); | |
}; | |
[as showInView:self.view]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment