Instance Method


Returns whether a rectangle contains a specified point.


func contains(_ point: CGPoint) -> Bool



The rectangle to examine.


The point to examine.

Return Value

true if the rectangle is not null or empty and the point is located within the rectangle; otherwise, false.


A point is considered inside the rectangle if its coordinates lie inside the rectangle or on the minimum X or minimum Y edge.

See Also

Checking Characteristics

func intersects(CGRect) -> Bool

Returns whether two rectangles intersect.

func contains(CGRect) -> Bool

Returns whether the first rectangle contains the second rectangle.

var isEmpty: Bool

Returns whether a rectangle has zero width or height, or is a null rectangle.

var isInfinite: Bool

Returns whether a rectangle is infinite.

var isNull: Bool

Returns whether the rectangle is equal to the null rectangle.