UIBezierPath: moveToPoint() method
The moveToPoint() method starts a new subpath, placing its start at the given position. It draws no line; it only moves the current point there.
Syntax
moveToPoint(point)Parameters
point
The new starting point, a CGPoint, in pt. Can also be a plain object { x, y }.
Return value
None (undefined).
Exceptions
TypeError
pointisn't an object:moveToPoint needs an object with all of: x, y.xoryis missing or can't be converted to a finite number:moveToPoint is missing y, or it is not a finite number.
Description
- After the call,
isEmptybecomesfalseandcurrentPointbecomespoint. - Calling it again on a path that already has segments starts a second subpath. The two aren't connected.
Examples
js
const path = new UIBezierPath();
path.moveToPoint(new CGPoint(0, 60));
console.log(path.isEmpty, String(path.currentPoint));Result: The console prints false CGPoint(0, 60).
Corresponding iOS API
-[UIBezierPath moveToPoint:].
See also
addLineToPoint(): draw a straight line from the current point- What a path is made of