Instance Method
nearestPoint(to:)
Finds the point on the path nearest a point.
Not available in Objective-C.Not available in Python.
Declaration
func nearestPoint(to location: CGPoint) -> (point: CGPoint, pathTime: CGFloat)?Return Value
The nearest point and its path time, or nil when no nearest point can be determined.
Discussion
A path time identifies a position within a path segment. Its integer part is the index of the ending on-curve node, and its fractional part is the position within the segment.
See Also
Path Time
The point at a path time, or
nilwhen the path time does not identify a position on the path.Returns the on-curve node nearest a path time.