Question

I have a UIBezierPath.

I wish to get an array of all the points in the path.

Is that possible?

Thanks Shani

Was it helpful?

Solution

Neither UIBezierPath nor CGPath have a method to obtain their points. This makes sense because the paths can be created with methods that are not simple points.

As @daveMac mentions in a comment there is a work-around:

void CGPathApply (
   CGPathRef path,
   void *info,
   CGPathApplierFunction function
);

For each element in the specified path, Quartz calls the applier function, which can examine (but not modify) the element.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top