Last active
November 10, 2019 05:52
-
-
Save c16a/d50e28d5669952cff2f7a781d7f7f203 to your computer and use it in GitHub Desktop.
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
UIAlertController* alert=[UIAlertController alertControllerWithTitle:@"Title" message:@"Message" preferredStyle:UIAlertControllerStyleAlert]; | |
UIAlertAction* yesButton = [UIAlertAction actionWithTitle:@"Yes" style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) { | |
NSLog(@"You pressed Yes, please button"); | |
// call method whatever u need | |
}]; | |
UIAlertAction* noButton = [UIAlertAction actionWithTitle:@"No" | |
style:UIAlertActionStyleDefault | |
handler:^(UIAlertAction * action) | |
{ | |
NSLog(@"you pressed No button"); | |
// call method whatever u need | |
}]; | |
[alert addAction:yesButton]; | |
[alert addAction:noButton]; | |
[self presentViewController:alert animated:YES completion:nil]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment