Positions the view within an invisible frame with the specified width and height.
SDKs
- iOS 13.0+
- macOS 10.15+
- Mac Catalyst 13.0+
- tvOS 13.0+
- watchOS 6.0+
- Xcode 11.0+
Framework
- Swift
UI
Declaration
Parameters
minWidth
The minimum width for the resulting frame.
idealWidth
The ideal width for the resulting frame.
maxWidth
The maximum width for the resulting frame.
minHeight
The minimum height for the resulting frame.
idealHeight
The ideal height for the resulting frame.
maxHeight
The maximum height for the resulting frame.
alignment
The alignment of this view inside the resulting frame.
alignment
applies if this view is smaller than the size given by the resulting frame.
Return Value
A view with flexible dimensions given by the call’s non-nil
parameters.
Discussion
Always specify at least one size characteristic when calling this method. Pass nil
or leave out a characteristic to indicate that the frame should adopt this view’s sizing behavior, constrained by the other non-nil
arguments.
Any non-nil
minimum, ideal, or maximum parameters specified for each dimension must be in ascending order.