TimOliver / TOCropViewController

A view controller for iOS that allows users to crop portions of UIImage objects
http://www.timoliver.com.au/2015/06/21/tocropviewcontroller-an-open-source-image-cropper-for-ios/
MIT License
4.71k stars 938 forks source link

The animated dismiss of cropViewController causes the previous viewcontroller to be disappeared #503

Open HassanTaleb90 opened 2 years ago

HassanTaleb90 commented 2 years ago

1)From the main VC present a child VC with modalPresentationStyle = .popover 2) Then from this child use the TOCropViewController 3) When we pic and image, if we press Cancel or Done, the child VC disappear and show the main VC the animation here cause the bug with the done button : cropViewController.dismiss(animated: true, completion: nil) so I turned it off, and no problem after that with done button , but there is no access to cancel button. Hack: to solve the issue I set the modalPresentationStyle = .fullScreen instead of .popover, but that is not nice.

maxkalik commented 2 years ago

@TimOliver Did you manage to solve this bug?

hordurhauks commented 2 years ago

I had the same issue. Ended up using a library called RSKImageCropper. Solves the problem I guess ¯\(ツ)

wonder2011 commented 2 years ago

Having same bug. Any solution yet ?

wonder2011 commented 2 years ago

Having same bug. Any solution yet ?

Coder-ACJHP commented 2 years ago

Still having same bug, done or cancel buttons dismiss both CropViewController and presentingViewController.

dypme commented 2 years ago

I found the solution to disable the custom transition from this lib, add transitioningDelegate property to CropViewController

let cropController = CropViewController(image: image)
cropController.transitioningDelegate = self
beforeold commented 1 year ago

thanks, as a work around, i make a subclass and override transitioningDelegate to nil on viewDidLoad()

lewis-smith commented 1 year ago

I did cropController.transitioningDelegate = nil is implied by the answers above and that fixed it for me.