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

    width

    The relative width of the ratio.

    height

    The relative height of the ratio.

  • Initializes with a specific ratio.

    Declaration

    Swift

    public init(ratio: CGFloat)

    Parameters

    ratio

    The width:height ratio.