Size
public struct Size : Sendable
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
widthThe width value of the size
heightThe height value of the size
-
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
widthThe width value of the size
heightThe 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
Comparableprotocol. The remainder of the relational operator functions are implemented by the standard library for any type that conforms toComparable.Declaration
Swift
public static func < (lhs: Size, rhs: Size) -> BoolParameters
lhsA value to compare.
rhsAnother value to compare.
-
Returns a Boolean value indicating whether two values are equal.
Equality is the inverse of inequality. For any values
aandb,a == bimplies thata != bisfalse.Declaration
Swift
public static func == (lhs: Size, rhs: Size) -> BoolParameters
lhsA value to compare.
rhsAnother value to compare.
View on GitHub