views:

61

answers:

1
+1  Q: 

Signature Panel

Hi Friends,

My requirements are I need a panel where user can make signature. The concept is like when user touches the screen and move the pointer, it should be marked with continuous line.

Please gimme some idea how to implement this??

Thanks in advance,

Regards, Rahul

+1  A: 

Subclass UIView and override the various UIResponder methods dealing with touch. Especially pay attention to touchesMoved:withEvent: - this is the method where you can get data about the previous/current points of the touch, and potentially add them to a set of points the touch has moved through. You can also override drawRect: in your custom UIView to draw a curve through all the points the touch has passed.

More info:

Tim
Additionally, one can use the CGContext path functions to draw the signature. Reference: http://developer.apple.com/documentation/graphicsimaging/conceptual/drawingwithquartz2d/dq_paths/dq_paths.html#//apple_ref/doc/uid/TP30001066-CH211-TPXREF101
rpetrich
Thanks Tim, touchMoved solved the issue....
Mohit