Present alert controller in example if user denied calendar permission.

This commit is contained in:
WenchaoD 2017-03-09 18:19:41 +08:00
parent 7656c324ab
commit b1548d7dc2
1 changed files with 2 additions and 4 deletions

View File

@ -258,11 +258,9 @@ NS_ASSUME_NONNULL_END
} else {
// Alert
UIAlertController *alertController = [[UIAlertController alloc] init];
alertController.title = @"Error";
alertController.message = @"Permission of calendar is required for fetching events.";
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Permission Error" message:@"Permission of calendar is required for fetching events." preferredStyle:UIAlertControllerStyleAlert];
[alertController addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleCancel handler:nil]];
[self presentViewController:alertController animated:YES completion:nil];
}
}];