pub struct SafeAreaLayoutGuide {
    pub top: LayoutAnchorY,
    pub leading: LayoutAnchorX,
    pub left: LayoutAnchorX,
    pub trailing: LayoutAnchorX,
    pub right: LayoutAnchorX,
    pub bottom: LayoutAnchorY,
    pub width: LayoutAnchorDimension,
    pub height: LayoutAnchorDimension,
    pub center_x: LayoutAnchorX,
    pub center_y: LayoutAnchorY,
}
Expand description

A SafeAreaLayoutGuide should exist on all view types, and ensures that there are anchor points that work within the system constraints. On macOS 11+, this will ensure you work around system padding transprently - on macOS 10.15 and under, this will transparently map to the normal edges, as the underlying properties were not supported there.

Fields

top: LayoutAnchorY

A pointer to the Objective-C runtime top layout constraint.

leading: LayoutAnchorX

A pointer to the Objective-C runtime leading layout constraint.

left: LayoutAnchorX

A pointer to the Objective-C runtime left layout constraint.

trailing: LayoutAnchorX

A pointer to the Objective-C runtime trailing layout constraint.

right: LayoutAnchorX

A pointer to the Objective-C runtime right layout constraint.

bottom: LayoutAnchorY

A pointer to the Objective-C runtime bottom layout constraint.

width: LayoutAnchorDimension

A pointer to the Objective-C runtime width layout constraint.

height: LayoutAnchorDimension

A pointer to the Objective-C runtime height layout constraint.

center_x: LayoutAnchorX

A pointer to the Objective-C runtime center X layout constraint.

center_y: LayoutAnchorY

A pointer to the Objective-C runtime center Y layout constraint.

Implementations

Given a view pointer, will extract the safe area layout guide properties and return a SafeAreaLayoutGuide composed of them.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.