shaps80 / SwiftUIBackports

A collection of SwiftUI backports for iOS, macOS, tvOS and watchOS
MIT License
931 stars 59 forks source link

Improve presentation detents backport #53

Closed Alex293 closed 1 year ago

Alex293 commented 1 year ago

https://github.com/shaps80/SwiftUIBackports/issues/52

Describe your changes

Improve PresentationDetents on iOS 15 by adding support for .height(value) as a detent. Note the backport is using private apis on iOS 15.0 to 16.0 and regular api above iOS 16.0.

The comparable implementation is not perfect and I think should be removed.

This is unfinished as I just leant about the .presentationDetents(undimmed:largestUndimmed:) but I wanted your feedback about the ObjC/Private api use

shaps80 commented 1 year ago

Sorry as mentioned in the issue, no private APIs will be accepted I'm afraid. You're welcome to fork and add this yourself through 👍