Reputation: 522
let cropViewController = CropViewController(image: images[0])
cropViewController.delegate = self
self.present(cropViewController, animated: true, completion: nil)
Dismissing this view controller from a delegate method , shows a black screen
func cropViewController(_ cropViewController: CropViewController,
didCropToImage image: UIImage,
withRect cropRect: CGRect,
angle: Int) {
// 'image' is the newly cropped version of the original image
cropViewController.dismiss(animated: true, completion: {
self.setImageAndReloadRow(image: image)
})
}
Xcode 11.5 and iOS13.5
Upvotes: 2
Views: 621
Reputation: 797
I had also same issue after selecting image and cropped,only black screen was appearing.
Replace
cropViewController.dismiss(animated: true, completion: nil).
With
let viewController = cropViewController.children.first!
viewController.modalTransitionStyle = .coverVertical
viewController.presentingViewController?.dismiss(animated: true, completion: nil)
Upvotes: 1