Rectangle

public struct Rectangle
extension Rectangle: Equatable

A structure that represents a rectangle.

Hexadecimal

  • 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

    x

    The x-coordinate of the point

    y

    The y-coordinate of the point

    width

    The width value of the size

    height

    The 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

    x

    The x-coordinate of the point

    y

    The y-coordinate of the point

    width

    The width value of the size

    height

    The height value of the size

  • 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: Rectangle, rhs: Rectangle) -> Bool

    Parameters

    lhs

    A value to compare.

    rhs

    Another value to compare.