Instance Method

position(x:y:)

Fixes the center of the view at the specified coordinates in its parent’s coordinate space.

Declaration

func position(x: CGFloat = 0, y: CGFloat = 0) -> some View

Parameters

x

The x-coordinate at which to place the center of this view.

y

The y-coordinate at which to place the center of this view.

Return Value

A view that fixes the center of this view at x and y.

See Also

Positioning a View

func position(CGPoint) -> View

Fixes the center of the view at the specified point in its parent’s coordinate space.

func offset(CGSize) -> View

Offsets the view by the horizontal and vertical distances in the given size.

func offset(x: CGFloat, y: CGFloat) -> View

Offsets the view by the specified horizontal and vertical distances.

func edgesIgnoringSafeArea(Edge.Set) -> View

Extends the view out of the safe area on the specified edges.

func coordinateSpace<T>(name: T) -> View

Assigns a name to this view’s coordinate space to which descendants of this view can refer.