translateBy(x:y:)
Moves subsequent drawing operations by an amount in each dimension.
Declaration
mutating func translateBy(x: CGFloat, y: CGFloat)Parameters
- x:
The amount to move in the horizontal direction.
- y:
The amount to move in the vertical direction.
Discussion
Calling this method is equivalent to updating the context’s transform directly using the given translation amount:
transform = transform.translatedBy(x: x, y: y)