Size

public struct Size
extension Size: Comparable

A structure that represents a two-dimensional size.

  • The width value of the size.

    Declaration

    Swift

    public var width: Int
  • The height value of the size.

    Declaration

    Swift

    public var height: Int
  • Creates a size with specified dimensions.

    Declaration

    Swift

    public init(width: Int, height: Int)

    Parameters

    width

    The width value of the size

    height

    The height value of the size

Hexadecimal

  • Size whose width and height are both zero.

    Declaration

    Swift

    public static let zero: Size
  • Creates a size with specified dimensions.

    Declaration

    Swift

    public init(width: Int32, height: Int32)

    Parameters

    width

    The width value of the size

    height

    The height value of the size

  • Returns a Boolean value indicating whether the value of the first argument is less than that of the second argument.

    This function is the only requirement of the Comparable protocol. The remainder of the relational operator functions are implemented by the standard library for any type that conforms to Comparable.

    Declaration

    Swift

    public static func < (lhs: Size, rhs: Size) -> Bool

    Parameters

    lhs

    A value to compare.

    rhs

    Another value to compare.

  • Returns a Boolean value indicating whether two values are equal.

    Equality is the inverse of inequality. For any values a and b, a == b implies that a != b is false.

    Declaration

    Swift

    public static func == (lhs: Size, rhs: Size) -> Bool

    Parameters

    lhs

    A value to compare.

    rhs

    Another value to compare.