Contents

reservedRegions(kind:options:)

Returns the reserved regions of a kind that overlap the view.

Declaration

@MainActor @preconcurrency func reservedRegions(kind: UIView.ReservedRegion.Kind, options: UIView.ReservedRegion.QueryOptions = []) -> [UIView.ReservedRegion]

Parameters

  • kind:

    The kind of reserved region to return, such as Occlusion or Division.

  • options:

    Options that change which regions the method returns. By default, the method returns only active regions. Pass Includeinactive to also return regions that aren’t currently active.

Return Value

The reserved regions that overlap the view, with frames in the view’s coordinate space.

Discussion

Use this method to arrange your view’s content around areas that the device hardware reserves, such as a camera or the fold of a hinge. UIKit tracks the regions you read in updateConstraints() and runs it again when the regions change.

For more information, see UIView.ReservedRegion.

See Also

Reserved regions