Advertisement
Guest User

Untitled

a guest
Jun 28th, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. UIPreviewAction *delete = [UIPreviewAction actionWithTitle:@"Delete" style:UIPreviewActionStyleDestructive handler:^(UIPreviewAction * _Nonnull action, UIViewController * _Nonnull previewViewController)
  2. {
  3.  
  4. //create alertController
  5. ...
  6.  
  7. // 1. present alertController:
  8. [self presentViewController:alertController animated:YES completion:nil];
  9.  
  10. // 2. Alternatively tried to present alertController using keyWindow
  11. UIViewController *top = [UIApplication sharedApplication].keyWindow.rootViewController;
  12. [top presentViewController:alertController animated:YES completion: nil];
  13.  
  14. //3. notify the presenting view controller that the user has deleted the image and set up an alert to occur after the peek view closes.
  15.  
  16. [[NSNotificationCenter defaultCenter] postNotificationName:@"deleteAlert" object:nil];
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement