alexhillc / AXPhotoViewer

An iOS/tvOS photo gallery viewer, useful for viewing a large (or small!) number of photos.
https://www.cocoacontrols.com/controls/axphotoviewer
MIT License
642 stars 120 forks source link

Freezes on action button #71

Open abdullahumer opened 4 years ago

abdullahumer commented 4 years ago

Hi

My app is freezing when tapped on the action and if save is selected from the action sheet.

The dismiss button and swipe also stops working.

kyoji2 commented 4 years ago

Same here. I've debug this issue, here is some findings: In iOS 13, dismiss method is called after save image action, which caused the problem. In iOS 12, everything works fine.

abdullahumer commented 4 years ago

Thanks, it works! The app is not freezing now.

I guess the default behaviour was supposed to dismiss the viewController after the save image action is selected but for some reasons, its not working in iOS 13.

My quick guess is that the dismiss should be done on completion of save image operation.

For now, your solution is the best. The users will have to manually close the view by swipe of by using the close button.

abdullahumer commented 4 years ago

After testing more, I found that the following actions are also causing the same issue:

In case of Save to Files, it takes too long. And if I tap the cancel, it does not close the activityViewController.

And I see an error log: [ShareSheet] cancelled request - error: The operation was cancelled.

abdullahumer commented 4 years ago

Alright, the cause of the above issues was your work around.

But this code fixes the issue:

        if self.presentedViewController != nil {
        //            super.dismiss(animated: flag, completion: completion)
            self.presentedViewController?.dismiss(animated: flag, completion: {
                completion?()
            })
            return
        }