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.67k stars 929 forks source link

Support UIModalPresentationStyle.overFullScreen #544

Open wtmoose opened 1 year ago

wtmoose commented 1 year ago

Is your feature request related to a problem? Please describe.

The framework currently requires UIModalPresentationStyle.fullScreen. However, can (and does) break some apps that use custom view controller presentation. We had to rework (and degrade) the navigation of our app to work with TOCropViewController.

With UIModalPresentationStyle.fullScreen, UIKit removes the presenting view controller's view from the view hierarchy. On dismissal, UIKit reinstalls the presenting view controller's view. However, this process is not robust when the presenting view controller itself is presented using a custom presentation.

In my specific case, we're using custom view controller presentation provided by SwiftMessages to display the presenting view controller. When TOCropViewController is dismissed, the presenting view controller's view is no longer visible because UIKit didn't properly restore the custom presentation's view hierarchy.

Describe the solution you'd like

Potential solutions in order of preference:

  1. Support all modal presentation styles
  2. Support UIModalPresentationStyle.overFullScreen
  3. Change from UIModalPresentationStyle.fullScreen to UIModalPresentationStyle.overFullScreen

Describe alternatives you've considered

We had to deviate from our app's navigation paradigm and use standard modal presentation with the flow that involves TOCropViewController.

babbage commented 1 month ago

See my response here because it is indeed possible to do what you want to do here. Not sure if it was possible when this was posted, but it is possible now. 👍🏼