A view’s size and its alignment guides in its own coordinate space.
SDKs
- iOS 13.0+
- macOS 10.15+
- Mac Catalyst 13.0+
- tvOS 13.0+
- watchOS 6.0+
- Xcode 11.0+
Framework
- Swift
UI
Declaration
struct ViewDimensions
A view’s size and its alignment guides in its own coordinate space.
SDKs
Framework
struct ViewDimensions
var height: CGFloat
The view’s height.
var width: CGFloat
The view’s width.
subscript(Vertical Alignment) -> CGFloat
Gets the value of the given vertical guide.
subscript(Horizontal Alignment) -> CGFloat
Gets the value of the given horizontal guide.
subscript(explicit: Vertical Alignment) -> CGFloat?
Gets the explicit value of the given alignment guide in this view, or nil
if no such value exists.
subscript(explicit: Horizontal Alignment) -> CGFloat?
Gets the explicit value of the given alignment guide in this view, or nil
if no such value exists.
func alignment Guide(Horizontal Alignment, compute Value: (View Dimensions) -> CGFloat) -> View
Sets the view’s horizontal alignment.
func alignment Guide(Vertical Alignment, compute Value: (View Dimensions) -> CGFloat) -> View
Sets the view’s vertical alignment.
protocol Alignment ID
Types used to identify alignment guides.