PDA

View Full Version : Drawing connector lines dynamically




arnieterm
Nov 20, 2009, 08:50 AM
Hi all
In my iphone application, I have to implement a feature as given below:
When user taps a point on the screen and start dragging then I have to show a line that is starting from the initial point of tap and will continue upto where the user releases the finger.
The line should continuously track the finger movement. At first sight it seems to be a drawing app but no it is a connector kind of application. By connector I mean to say the feature in Interface Builder when we bind a Referencing Outlet to a UIView element than a blue line appears temporarily upto the time when user keeps pressing the mouse button and the line disappears when the mouse button is released.
Using CoreGraphics, I think we can draw the line but how can I erase the previous drawn line

THanks
Arnieterm



dejo
Nov 20, 2009, 10:50 AM
As a matter of fact, there is an example of a program that does this in Chapter 12 of "Beginning iPhone 3 Development" by Dave Mark and Jeff LaMarche.