Constants that define how a view's content fills the available 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
@frozen enum ContentMode
Constants that define how a view's content fills the available space.
SDKs
Framework
@frozen enum ContentMode
static func != (Content Mode, Content Mode) -> Bool
Indicates whether two values are not equal.
func scaled To Fill() -> View
Scales the view to fill its parent.
func scaled To Fit() -> View
Scales the view to fit its parent.
func scale Effect(CGFloat, anchor: Unit Point) -> View
Scales this view’s rendered output by the given amount in both the horizontal and vertical directions, relative to an anchor point.
func scale Effect(CGSize, anchor: Unit Point) -> View
Scales this view’s rendered output by the given vertical and horizontal size amounts, relative to an anchor point.
func scale Effect(x: CGFloat, y: CGFloat, anchor: Unit Point) -> View
Scales this view’s rendered output by the given horizontal and vertical amounts, relative to an anchor point.
func aspect Ratio(CGFloat?, content Mode: Content Mode) -> View
Constrains the view’s dimensions to the specified aspect ratio.
func aspect Ratio(CGSize, content Mode: Content Mode) -> View
Constrains the view’s dimensions to the aspect ratio of the specified size.
func image Scale(Image .Scale) -> View
Sets the scale of images inside the view.