ZLImageEditor icon indicating copy to clipboard operation
ZLImageEditor copied to clipboard

Black screen after clip (SwiftUI presentingViewController issue)

Open olischne opened this issue 6 months ago • 0 comments

After leaving the ZLClipImageViewController, the screen is black.

Steps to reproduce:

  1. Run SwiftUIExample
  2. Open image
  3. select clip symbol
  4. dismiss (e. g. by cancelling)
  5. 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.

olischne avatar Jun 18 '25 11:06 olischne