Drawing rubber band line during user drag

Posted by Pete W on Stack Overflow See other posts from Stack Overflow or by Pete W
Published on 2010-05-31T04:48:00Z Indexed on 2010/05/31 4:52 UTC
Read the original article Hit count: 228

Filed under:

In my iPhone app, I would like the user to be able to "connect" two of my views by:

1) starting a drag in View A 2) as they drag towards View B, a straight line with one end in View A and the other end under at the current drag point, animates in a rubber-band fashion 3) when/if they release in View B, the line is then shown between the two views

I've seen examples of dragging and dropping views, and other examples of animations, but I haven't seen one that is a simple example of this kind of user-directed animation. Any pointers towards examples or the specific docs I should be looking at would be appreciated.

If this turns out to be trivial - my apologies. Although I've done quite a bit of development, I'm just getting started in the iPhone SDK and Core Graphics.

© Stack Overflow or respective owner

Related posts about iphone