Tocropviewcontroller: Doesn't work on iOS 13.1

Created on 30 Aug 2019  ·  16Comments  ·  Source: TimOliver/TOCropViewController

After selecting a photo, only black empty image appears in cropping view. (tested on 2.4.0, swift 5)

bug rfc

Most helpful comment

Replace
cropViewController.dismiss(animated: true, completion: nil).

With
let viewController = cropViewController.children.first! viewController.modalTransitionStyle = .coverVertical viewController.presentingViewController?.dismiss(animated: true, completion: nil)

All 16 comments

Thanks for the feedback! I don’t have any time to investigate right now so any help in diagnosing the issue would be appreciated!

TimOliver I have one solution but just am testing final once

This seems to be an issue w/ permissions.

createDataWithMappedFile:1508:  'open' failed '/var/mobile/Media/PhotoData/CPLAssets/group498/E850D458-F829-4B19-8FBF-95D6F6CC34BA.HEIC'    error = 1 (Operation not permitted)

Do you see the same logs?

My app does have full album permission. This does not seem to be the case.

It works as usual in 13.1 beta2. This issue could be a bug for 13.1 beta 1 only.

I'd like to share more testing info:

(1) My app does not request explicit permission of photo library access. (https://stackoverflow.com/questions/46404628/ios11-photo-library-access-is-possible-even-if-settings-are-set-to-never)
(2) There was no issue on up to iOS 12.4.1 (Latest) - everything has worked out well!
(3) There was no test in iOS 13.0 beta, but I guess there was no problem in version 13.0.
(4) I got the problem in 13.1 beta 1
(5) The problem was fixed in version 13.1 beta 2

Could you please share with me official docu or any info about permission change in iOS 13?

Ignore this. My problem was solved with https://github.com/TimOliver/TOCropViewController/issues/365

Same issue facing. After selecting image, only black screen appear.

Replace
cropViewController.dismiss(animated: true, completion: nil).

With
let viewController = cropViewController.children.first! viewController.modalTransitionStyle = .coverVertical viewController.presentingViewController?.dismiss(animated: true, completion: nil)

@Stijnk008 Thank you. It's working fine.

Changes require to update in repo.

@Stijnk008 You sir are an absolute legend! You just saved me hours before a Live Demo Day. phew!

Still experiencing this issue in the most recent official 13.1.2 release. The solution of Stijnk008 does still work in this case.
Does the library need an update?
Could anyone explain as to why the behaviour is this odd with the new ios versions?

this working for me:

func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) {
        guard let image = (info[UIImagePickerController.InfoKey.originalImage] as? UIImage) else { return }
        let cropController = CropViewController(croppingStyle: croppingStyle, image: image)
        cropController.delegate = self
        cropController.customAspectRatio = CGSize(width: 1.0,height: 1.2)
        cropController.aspectRatioLockEnabled = true
        cropController.resetAspectRatioEnabled = false
        cropController.modalPresentationStyle = .fullScreen

        picker.dismiss(animated: true, completion: {
            let viewController = cropController.children.first!
            viewController.modalTransitionStyle = .coverVertical
            viewController.presentingViewController?.dismiss(animated: true, completion: nil)
// the code below allows you to present the cropController ( for me )
            self.row?.delegate?.present(cropController, animated: true, completion: nil)  
        })
    }

Hey folks! Um, so I just added modalPresentationStyle = .fullScreen to the library in the master branch. This SHOULD hopefully resolve the majority of the weird behaviours the library was exhibiting.

If you're still having this issue, can you please pull from master and see if that's fixed?

In the meantime, I've noticed there's a lot of visual glitching on non-FaceID devices, so I have to prioritise that now.

Thanks!

@Stijnk008 Just i replace and Works Fine 😀 Thanks

Cool. I think this has been resolved. Please open a new issue if anyone else runs into the same issue!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ojseven picture ojseven  ·  7Comments

ntnmrndn picture ntnmrndn  ·  4Comments

agusguerra10 picture agusguerra10  ·  5Comments

Srosman picture Srosman  ·  3Comments

TimOliver picture TimOliver  ·  4Comments