Need to draw a spline from a multiple points in drawRect. Is it possible to "throw" an array of points and draw continuous spline from them. Another option would be to loop among the points and to draw multiple splines, drawing a spline from 2 points at a time. I suppose such continuous spline is called B-spline?
Asked
Active
Viewed 200 times
1 Answers
1
You would use UIBezierPath
and its -addCurveToPoint:controlPoint1:controlPoint2:
or -addQuadCurveToPoint:controlPoint:
method. You'll have to calculate the control points yourself.

Ken Thomases
- 88,520
- 7
- 116
- 154
-
Thanks, but still, these are for drawing a curve between two points only. Looks like it's the only way :( – Centurion Jun 13 '12 at 13:12
-
Each invocation of one of those methods adds an additional point to the curve. You can build up a curve going through many points. – Ken Thomases Jun 13 '12 at 13:30
-
Yes, I understood that but still, I will need to loop though the points manually. It's OK with the solution, just curious are there options for making one draw statements call and to pass an array of points. – Centurion Jun 13 '12 at 13:39