Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- UIPreviewAction *delete = [UIPreviewAction actionWithTitle:@"Delete" style:UIPreviewActionStyleDestructive handler:^(UIPreviewAction * _Nonnull action, UIViewController * _Nonnull previewViewController)
- {
- //create alertController
- ...
- // 1. present alertController:
- [self presentViewController:alertController animated:YES completion:nil];
- // 2. Alternatively tried to present alertController using keyWindow
- UIViewController *top = [UIApplication sharedApplication].keyWindow.rootViewController;
- [top presentViewController:alertController animated:YES completion: nil];
- //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.
- [[NSNotificationCenter defaultCenter] postNotificationName:@"deleteAlert" object:nil];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement