One Logo Pool Ball
SwiftUICore · IOS API REFERENCE

ReservedRegion

struct · iOS 27.1+ · SDK 27.1

struct ReservedRegion

A region within a view's coordinate space that has been reserved by another entity. A reserved region indicates that an area within a view's coordinate space has been claimed by something the view does not own. The view should arrange its content to account for this region. Each region describes a frame, margins, active state, and an identifier. Regions are categorized by their kind, ``ReservedRegion.Kind``. There are two kinds of reserved regions: - ``ReservedRegion.Kind/occlusion``: An area that is occluded by an element, such as a Dynamic Island, a camera or window controls. - `division`: An area where content should split into separate regions, such as at the fold of a hinge. You read reserved regions using the ``GeometryProxy/reservedRegions(kind:)`` method. This method returns all of the reserved regions that currently intersect your view regardless of whether they are currently active. In the example below, the reserved regions are passed to a custom ``Layout`` which handles positioning its subviews away from any regions that intersect it. GeometryReader { proxy in RegionAvoidingLayout( regions: proxy.reservedRegions(kind: .occlusion) ) { ForEach(items) { item in ItemView(item) } } } When manually positioning your content to incorporate reserved regions, take care to consider right to left layout directions. Reserved regions are often in a fixed coordinate space; the absolute location of the camera of a device does not flip depending on the user's preferred language. By default, the system mirrors the geometry of these regions to automatically handle being provided to most SwiftUI APIs. For example, a ``Layout`` will automatically flip the geometry of the subviews you place. By mirroring the geometry of the reserved regions, your layout does not need to account for the layout direction when determining whether a particular subview will intersect the region. There may be cases when you need to make more manual adjustments for the frames of reserved regions for right to left layout directions. In these cases, you can provide the ``LayoutDirectionBehavior/fixed`` value to the method and the system will not mirror the frames of the regions. proxy.reservedRegions( kind: .occlusion, layoutDirectionBehavior: .fixed)

Members (5)

get · iOS 27.1+

id

TypeScript
get id(): ReservedRegion_ID
Swift declaration
var id: ReservedRegion.ID { get }

The identifier of the region.

get · iOS 27.1+

kind

TypeScript
get kind(): ReservedRegion_Kind
Swift declaration
var kind: ReservedRegion.Kind { get }

The kind of the region.

get · iOS 27.1+

frame

TypeScript
get frame(): { x: number; y: number; width: number; height: number }
Swift declaration
var frame: CGRect { get }

The rect of the region in the view's coordinate space, including the margins.

get · iOS 27.1+

margins

TypeScript
get margins(): EdgeInsets
Swift declaration
var margins: EdgeInsets { get }

The margins included in the frame around the rect for interactive content.

get · iOS 27.1+

isActive

TypeScript
get isActive(): boolean
Swift declaration
var isActive: Bool { get }

Whether the region is active.

Skipped declarations

No declarations were skipped in this snapshot.

All SwiftUICore types →