I'm starting out with a straight line and I would like the user to be able to touch and drag the line so that it curves. Effectively, they would have the ability to manipulate the line into a wave shape. I'm not sure of the easiest way of achieving this technically.
I had started by creating an array of UIBezierPaths of cubic curves with the intention of manipulating the control points - but it appears that it is not possible to alter the control points of UIBezierPaths once they have been drawn?
Any suggestions as to the simplest technical approach appreciated.
You can draw a quadCurve (one control point Bezier curve) in drawRect using variables as control points, and then update the control points in the touchesBegan method as follows. Note that you need to redraw with setNeedsDisplay
If you have multiple control points, then some visual elements and extra logic is required in the touchesMoved method... e