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
646 stars 119 forks source link

Fix dismissing viewController with dismiss(animated:completion:) method #64

Open i5glu opened 5 years ago

i5glu commented 5 years ago

I use your gallery in my app, it's very nice, but if found issue: When you try to dismiss photoViewer calling dismiss(animated:completion:) from another class, app freezes. It's because transitionController has flag "forceNonInteractiveDismissal" set to false and "interactionControllerForDismissal" return dismissal animator, while it should return nil to perform non interactive dismissal correctly.

I renamed flag "forceNonInteractiveDismissal" to "forceInteractiveDismissal" and changed logic, so interaction dismissal begins with gesture recognizer, and default dismissal is now non interactive.