Tocropviewcontroller: App goes to a blank screen after dismissed or dismissAnimatedFrom. no error info and no clue - Swift

Created on 27 Sep 2019  ·  3Comments  ·  Source: TimOliver/TOCropViewController

Describe the bug

This happened with new Xcode and iOS updates ( don't know if this is the exact issue). it was working fine. but with the dismiss or dismissAnimatedFrom called, whole screen turn into a blank black. no any error or nothing.

To Reproduce
Steps to reproduce the behavior:

  • To make sure, I created a new project and implemented the CroppedViewController, it gives me the same result. here is how I use it. everything woks fine until here.
public func updateImageViewWithImage(_ image: UIImage, fromCropViewController cropViewController: CropViewController) {
        imageView.image = image
        layoutImageView()

        self.navigationItem.rightBarButtonItem?.isEnabled = true

        if cropViewController.croppingStyle != .circular {
            imageView.isHidden = true

            cropViewController.dismissAnimatedFrom(self, withCroppedImage: image,
                                                   toView: imageView,
                                                   toFrame: CGRect.zero,
                                                   setup: { self.layoutImageView() },
                                                   completion: {
                                                    self.imageView.isHidden = false })
        }
        else {
            self.imageView.isHidden = false
            cropViewController.dismiss(animated: true, completion: nil)
        }
    }

Expected behavior
Cropped image should show and CroppedViewController should dismiss.

Screenshots
Here is a gif to give you a clear idea.

GitErrGif

iOS Device:

  • Device: tested with (iPhone 7+, iPhoneX)
  • OS: all are iOS 13
  • Library Version - latest
  • Language - Swift

Additional context

  • I tried to just dismiss the CroppedViewController, but it also didn't success.
  • Forked and cloned the project and went through it. seems like issue is with CropViewController.swift, not with TO
  • Finally Thanks for this awesome library.
bug

Most helpful comment

@anuradhss

cropViewController.modalPresentationStyle = .fullScreen

Should fix this issue

All 3 comments

@anuradhss

cropViewController.modalPresentationStyle = .fullScreen

Should fix this issue

@lmr-soltanov yep, it works and updated at the repo as well. thanks

Thank you @lmr-soltanov & @anuradhss
It's working.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yarodevuci picture yarodevuci  ·  8Comments

kcankaynak picture kcankaynak  ·  4Comments

dddOO7 picture dddOO7  ·  5Comments

erickva picture erickva  ·  4Comments

TimOliver picture TimOliver  ·  4Comments