Instance Method

position(x:y:)

Fixes the center of this 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

Setting the Position of a View

func position(CGPoint) -> View

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

Beta
func offset(CGSize) -> View

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

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

Offsets this view by the specified horizontal and vertical distances.

Beta
func edgesIgnoringSafeArea(Edge.Set) -> View

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

Beta

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software