Structure

ViewDimensions

A view’s size and its alignment guides in its own coordinate space.

Declaration

struct ViewDimensions

Topics

Getting the Dimensions

var height: CGFloat

The view’s height.

var width: CGFloat

The view’s width.

Accessing Guide Values

subscript(VerticalAlignment) -> CGFloat

Gets the value of the given vertical guide.

subscript(HorizontalAlignment) -> CGFloat

Gets the value of the given horizontal guide.

subscript(explicit: VerticalAlignment) -> CGFloat?

Gets the explicit value of the given alignment guide in this view, or nil if no such value exists.

subscript(explicit: HorizontalAlignment) -> CGFloat?

Gets the explicit value of the given alignment guide in this view, or nil if no such value exists.

Relationships

Conforms To

See Also

Setting the Position of a View

func position(CGPoint) -> View

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

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

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

Beta
func offset(CGSize) -> View

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

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

Offsets the 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