I'd like to try implementing a visual swipe for an iPhone project, like they do in some games, like Fruit Ninja. As you drag your finger around the screen, it leaves a trail that disappears after a while. I would think that you could have a fixed number of points in the "chain" and as new points are added to the front, old ones are removed from the rear. I can see using -touchesMoved
to generate new points and an NSMutableArray
to keep track of the points. I just can't imaging what method I'd use to actually draw the segments. Would I make one CALayer
and draw a line connecting the active points? Or use some other view object and join them together at the points...
Any ideas?