2

I have a UIBezierPath.

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

Is that possible?

Thanks Shani

Devin
  • 7,690
  • 6
  • 39
  • 54
shannoga
  • 19,649
  • 20
  • 104
  • 169
  • There is a `UIBezierPath` and a `CGPath` but no `CGPath`. Please restate your question. – zaph Jan 29 '12 at 14:57
  • Possible duplicate of http://stackoverflow.com/questions/3051760/getting-a-list-of-points-from-a-uibezierpath – Devin Dec 10 '14 at 20:06

1 Answers1

2

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.

zaph
  • 111,848
  • 21
  • 189
  • 228
  • 1
    What about CGPathApply? I do the very thing the OP is asking quite often when I need to dissect a path. – daveMac May 31 '12 at 23:57