The regular .sheet
is too big for my use case, it almost covers the whole screen on iPad. I need to display a .sheet with UIModalPresentationStyle.formSheet
.
How can I do that with SwiftUI?
The regular .sheet
is too big for my use case, it almost covers the whole screen on iPad. I need to display a .sheet with UIModalPresentationStyle.formSheet
.
How can I do that with SwiftUI?
As shown in the documentation, you could use .presentationDetents on .sheet because default is large. The example is:
struct ContentView: View {
@State private var showSettings = false
var body: some View {
Button("View Settings") {
showSettings = true
}
.sheet(isPresented: $showSettings) {
SettingsView()
.presentationDetents([.medium, .large])
}
}
}