Last active
August 12, 2018 18:19
-
-
Save nishabe/9f258ecfc3c3c8b4a9d7 to your computer and use it in GitHub Desktop.
OBJC:UIAlertController : 'UIAlertView' is deprecated, use UIAlertController with a preferredStyle
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 example. 'UIAlertView' is deprecated: first deprecated in iOS 9.0 - UIAlertView is deprecated. | |
// Use UIAlertController with a preferredStyle of UIAlertControllerStyleAlert instead | |
// More at: http://useyourloaf.com/blog/uialertcontroller-changes-in-ios-8/ | |
- (void) handleError{ | |
UIAlertController *alertController = [UIAlertController | |
alertControllerWithTitle:nil | |
message:@"Incorrect Credentials" | |
preferredStyle:UIAlertControllerStyleAlert]; | |
UIAlertAction *okAction = [UIAlertAction | |
actionWithTitle:NSLocalizedString(@"OK", @"OK action") | |
style:UIAlertActionStyleDefault | |
handler:^(UIAlertAction *action) | |
{ | |
NSLog(@"OK action"); | |
}]; | |
[alertController addAction:okAction]; | |
[self presentViewController:alertController animated:YES completion:nil]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment