Created
September 17, 2016 05:46
-
-
Save RameshAran/37144e9d02ff5a6268b2b2e45267f1a5 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
- (void)showActionSheetWithTwoButtons { | |
UIAlertController *alertView = [UIAlertController alertControllerWithTitle:@"ActionSheet!" | |
message:@"This is an ActionSheet." | |
preferredStyle:UIAlertControllerStyleActionSheet]; | |
[alertView addAction:[UIAlertAction actionWithTitle:@"ok" | |
style:UIAlertActionStyleDefault | |
handler:^(UIAlertAction *action) { | |
NSLog(@"action - %@", action.title); | |
}]]; | |
[alertView addAction:[UIAlertAction actionWithTitle:@"Cancel" | |
style:UIAlertActionStyleDefault | |
handler:^(UIAlertAction *action) { | |
NSLog(@"action - %@", action.title); | |
}]]; | |
[self presentViewController:alertView animated:YES completion:^{ | |
NSLog(@"alertView shown!"); | |
}]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Create an Actionsheet with two buttons.