Guest User

Untitled

a guest
Jan 17th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.99 KB | None | 0 0
  1. UIAlertController *alertController = [UIAlertController alertControllerWithTitle:LocalizedString(@"Success")
  2. message:LocalizedString(@"Example") preferredStyle:UIAlertControllerStyleAlert];
  3. UIAlertAction *actionOk = [UIAlertAction actionWithTitle:LocalizedString(@"Ok")
  4. style:UIAlertActionStyleDefault
  5. handler:^(UIAlertAction *action){
  6. [self dismissViewControllerAnimated:YES completion:^
  7. {
  8. [self performSelector:@selector(presentLogInViewController) withObject:nil];
  9. }];
  10. }];
  11. [alertController addAction:actionOk];
  12. [self presentViewController:alertController animated:YES completion:nil];
  13.  
  14. UIAlertController *alertController = [UIAlertController alertControllerWithTitle:LocalizedString(@"Success")
  15. message:LocalizedString(@"Example")
  16. preferredStyle:UIAlertControllerStyleAlert];
  17.  
  18. UIAlertAction *actionOk = [UIAlertAction actionWithTitle:LocalizedString(@"Ok")
  19. style:UIAlertActionStyleDefault
  20. handler:^(UIAlertAction *action) {
  21. [self performSelector:@selector(presentLogInViewController) withObject:nil];
  22. }];
  23.  
  24. [alertController addAction:actionOk];
  25. [self presentViewController:alertController animated:YES completion:nil];
  26.  
  27. UIAlertAction* cancelAction = [UIAlertAction actionWithTitle:@"Ok" style:UIAlertActionStyleDefault handler:^(UIAlertAction * action)
  28. {
  29. [alertController dismissViewControllerAnimated:YES completion:nil];
  30. }];
  31. [alertController addAction:cancelAction];
  32. [self presentViewController: alertController animated:YES completion:nil];
  33.  
  34. UIAlertController* alert = [UIAlertController alertControllerWithTitle:@"My Alert"
  35. message:@"This is an alert."
  36. preferredStyle:UIAlertControllerStyleAlert];
  37.  
  38. UIAlertAction* defaultAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault
  39. handler:^(UIAlertAction * action) {
  40. // here you can add the completion for when the OK button is pressed
  41. }];
  42. [alert addAction:defaultAction];
  43. [self presentViewController:alert animated:YES completion:nil];
Add Comment
Please, Sign In to add comment