AspectRatio
public struct AspectRatio
Represents an a proportional relationship between width and height.
-
A 1:1 aspect ratio.
Declaration
Swift
public static let square: AspectRatio -
The width:height ratio value.
Declaration
Swift
public var ratio: CGFloat -
Initializes with a width & height ratio.
Declaration
Swift
public init(width: CGFloat, height: CGFloat)Parameters
widthThe relative width of the ratio.
heightThe relative height of the ratio.
-
Initializes with a specific ratio.
Declaration
Swift
public init(ratio: CGFloat)Parameters
ratioThe width:height ratio.
View on GitHub
AspectRatio Structure Reference