Contents

CGRectOffset(_:_:_:)

Returns a rectangle with an origin that is offset from that of the source rectangle.

Declaration

func CGRectOffset(_ rect: CGRect, _ dx: CGFloat, _ dy: CGFloat) -> CGRect

Parameters

  • rect:

    The source rectangle.

  • dx:

    The offset value for the x-coordinate.

  • dy:

    The offset value for the y-coordinate.

Return Value

A rectangle that is the same size as the source, but with its origin offset by dx units along the x-axis and dy units along the y-axis with respect to the source. Returns a null rectangle if rect is a null rectangle.

See Also

Modifying Rectangles