.presentationDetents([.fraction( 1), .height(400), .medium, .large])
using .cornerRadius(INT) does not work here, there seems to be no way to set a corner radius.
.presentationDetents([.fraction( 1), .height(400), .medium, .large])
using .cornerRadius(INT) does not work here, there seems to be no way to set a corner radius.
2
Answers
It’s not possible to change the corner radius of a sheet in SwiftUI until iOS 16.4 (which is still in beta at the time of writing). iOS 16.4 adds a
presentationCornerRadius:
modifier: https://developer.apple.com/documentation/swiftui/view/presentationcornerradius(_🙂The iOS 16.4 SDKs are included in Xcode 14.3 (also in beta at the time of writing).
This is the sample code copied from Apple’s documentation on the new modifier:
If you need to support older versions of iOS, there are fully or partially custom solutions for you
Popular packages that do not overuse the native modal dialogs implementation:
This package was written by me and uses Apple’s private API and allows you to customize native modal dialogs:
NativePartialSheet