Rectangle
public struct Rectangle : Sendable
extension Rectangle: Equatable
A structure that represents a rectangle.
-
Rectangle at the origin whose width and height are both zero.
Declaration
Swift
public static let zero: Rectangle -
Creates a rectangle at specified point and given size.
Declaration
Swift
public init(x: Int, y: Int, width: Int, height: Int)Parameters
xThe x-coordinate of the point
yThe y-coordinate of the point
widthThe width value of the size
heightThe height value of the size
-
Creates a rectangle at specified point and given size.
Declaration
Swift
public init(x: Int32, y: Int32, width: Int32, height: Int32)Parameters
xThe x-coordinate of the point
yThe y-coordinate of the point
widthThe width value of the size
heightThe height value of the size
-
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: Rectangle, rhs: Rectangle) -> BoolParameters
lhsA value to compare.
rhsAnother value to compare.
View on GitHub