Contents

CGRectContainsRect(_:_:)

Returns whether the first rectangle contains the second rectangle.

Declaration

func CGRectContainsRect(_ rect1: CGRect, _ rect2: CGRect) -> Bool

Parameters

  • rect1:

    The rectangle to examine for containment of the rectangle passed in rect2.

  • rect2:

    The rectangle to examine for being contained in the rectangle passed in rect1.

Return Value

true if the rectangle specified by rect2 is contained in the rectangle passed in rect1; otherwise, false. The first rectangle contains the second if the union of the two rectangles is equal to the first rectangle.

See Also

Checking for Membership