Structure

Alignment

An alignment in both axes.

Declaration

@frozen struct Alignment

Overview

The following table show the various alignment guides next to each other.

topLeading

top

topTrailing

leading

center

trailing

bottomLeading

bottom

bottomTrailing

Topics

Guides

static let bottom: Alignment

A guide marking the bottom edge of the view.

static let bottomLeading: Alignment

A guide marking the bottom and leading edges of the view.

static let bottomTrailing: Alignment

A guide marking the bottom and trailing edges of the view.

static let center: Alignment

A guide marking the center of the view.

static let leading: Alignment

A guide marking the leading edge of the view.

static let top: Alignment

A guide marking the top edge of the view.

static let topLeading: Alignment

A guide marking the top and leading edges of the view.

static let topTrailing: Alignment

A guide marking the top and trailing edges of the view.

static let trailing: Alignment

A guide marking the trailing edge of the view.

Creating a Custom Alignment

init(horizontal: HorizontalAlignment, vertical: VerticalAlignment)

Creates an instance with the given horizontal and vertical alignments.

var horizontal: HorizontalAlignment

The alignment on the horizontal axis.

var vertical: VerticalAlignment

The alignment on the vertical axis.

Operator Functions

static func != (Alignment, Alignment) -> Bool

Returns a Boolean value indicating whether two values aren’t equal.

static func == (Alignment, Alignment) -> Bool

Returns a Boolean value indicating whether two values are equal.

Relationships

Conforms To

See Also

Creating a Stack

init(alignment: Alignment, content: () -> Content)

Creates an instance with the given alignment.