ZLImageEditor
ZLImageEditor copied to clipboard
Black screen after clip (SwiftUI presentingViewController issue)
After leaving the ZLClipImageViewController, the screen is black.
Steps to reproduce:
- Run SwiftUIExample
- Open image
- select clip symbol
- dismiss (e. g. by cancelling)
- black screen
Error:
The ZLEditImageViewController is wrapped in a UIViewControllerRepresentable to show it in SwiftUI, which causes the presentingViewController (in ZLClipImageViewController.viewDidAppear and ZLClipImageDismissAnimatedTransition.animateTransition) to not be as expected:
po presentingViewController
▿ Optional<UIViewController>
▿ some : <_TtGC7SwiftUI29PresentationHostingControllerVS_7AnyView_: 0x10484a400>
Because of this, the transitioningDelegate is not set and ZLEditImageViewController.finishClipDismissAnimate() is never called -> the alpha values remain at 0.