iPhone Duo SwiftUI layouts
Explore interactive SwiftUI previews across every available orientation and hinge state.
15elements
GeometryReader
Reserved Regions
Returns the reserved regions for the given kind. A reserved region indicates that an area within a view’s coordinate space has been claimed by something the view does not own
A bezel is not available for Partially Open yet. The screenshot is shown without one.
SwiftUI code
var body: some View {
GeometryReader { proxy in
ZStack(alignment: .topLeading) {
ForEach(proxy.reservedRegions(kind: .division)) { region in
regionView(region, color: .blue)
}
ForEach(proxy.reservedRegions(kind: .occlusion)) { region in
regionView(region, color: .orange)
}
}
}
}
private func regionView(_ region: ReservedRegion, color: Color) -> some View {
Rectangle()
.fill(color)
.frame(width: region.frame.width, height: region.frame.height)
.offset(x: region.frame.minX, y: region.frame.minY)
}Compatibility
iOS 27.1+ iPadOS 27.1+
Tags
methodreservedRegionsocclusiondivision
Found an issue or have a suggestion?
All variants
Every available iPhone Duo screenshot for Reserved Regions.