Reputation:
I am working on one application in that I need to get User input for UIBezierPath and in that case I have CGPoints array so my question is How can I Create or Define UIBezierPath from CGPoints.
I have searched a lot but not getting any positive information so please suggest me some informative things for my problem.
For Example :- If user Draw something on the screen then I need to detect that Drawing and respond accordingly (I have also try with Custom gesture recognition but not getting success so have to move on UIBezierPath).
Please give me proper guidance.
Thanks.
Upvotes: 4
Views: 4013
Reputation: 21996
For the first case it's enough to add manually all the points, possibly in a loop.
For the second case see this method:
+ (UIBezierPath *)bezierPathWithCGPath:(CGPathRef)CGPath;
Upvotes: 4
Reputation: 53561
UIBezierPath *path = [UIBezierPath bezierPath];
[path moveToPoint:point1];
[path addLineToPoint:point2];
[path addLineToPoint:point3];
//...
Upvotes: 1