iPhone SwiftUI layouts
Explore SwiftUI APIs, components, and modifiers with interactive iPhone previews, Swift code, and Apple documentation. Compare every available orientation, appearance, and design.
201elements
Sheet
Sheet Background Interaction
Controls whether people can interact with the view behind a presentation.
Explore Sheet Background Interaction on iPhone in portrait, with SwiftUI code and Apple API documentation.
SwiftUI code
@State var showSheet = true
var body: some View {
Button("You can still tap on me with the sheet open") {
showSheet.toggle()
}
.padding(.bottom, 120)
.sheet(isPresented: $showSheet) {
sheetContent
.presentationDetents([.medium])
.presentationBackgroundInteraction(.enabled)
}
}Compatibility
iOS 16.4+ iPadOS 16.4+ macOS 13.3+ watchOS 9.4+ tvOS 16.4+ visionOS 1.0+
Tags
Found an issue or have a suggestion?
All variants
Every available iPhone screenshot for Sheet Background Interaction.