-
-
Save bsdshell/433ce9361ac3cd8bd15d to your computer and use it in GitHub Desktop.
UIAlertController alert message
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:@"My Alert" | |
message:@"This is an alert." | |
preferredStyle:UIAlertControllerStyleAlert]; | |
UIAlertAction* defaultAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault | |
handler:^(UIAlertAction * action) { | |
NSLog(@"this is my action"); | |
}]; | |
[alert addAction:defaultAction]; | |
[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