ios - Get all vertices of a UIBezierPath -


i have uibezierpath made 6 vertices. want vertices uibezierpath. there possible way it?

you using cgpathapply , cgpathapplierfunction.

nsmutablearray *thepoints = [[nsmutablearray alloc] init]; uibezierpath *apath; cgpath thecgpath = apath.cgpath; cgpathapply(thecgpath, thepoints, mycgpathapplierfunc); 

what pass on applier function each of path's elements. can list of points each element inside function , add them thepoints.

your applier function like

void mycgpathapplierfunc (void *info, const cgpathelement *element) {     nsmutablearray *thepoints = (nsmutablearray *)info;      cgpoint *points = element->points;     [thepoints addobject:[nsvalue valuewithcgpoint:points[0]]];      \\only 1 point assuming line      \\curves may have more 1 point in points array. handle accordingly.  } 

Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -