views:

25

answers:

1

It was kind simple in other OS. I just got mouse movement x and y and redraw my character, however I do not see mouse event in Cocoa. COuld somebody point on a code samples?

A: 

What you want is a UIPanGestureRecognizer (see the WWDC10 videos gesture recognizer videos). With the Pan gesture recognizer, when the user press and holds their finger, then begins to drag it, you can get direction of the drag, redraw as they drag.

Get the coordinates in the frame where they were touched, use that as a the point by which you animate your view, so the view always moves where the user started dragging from.

jer
That assumes the questioner meant Cocoa Touch and not Cocoa.
Peter Hosey
Oops, I forgot I had the cocoa tag being highlighted. Though with "touch" also tagged, I'll leave this answer until we hear if he meant cocoatouch or cocoa.
jer