Question

I am modifying the "MoveMe" example from the apple web site. When my controller gets the "touchesMoved" message it moves the object being moved to the centre of the touch, because (pseudocode) object.center = touch.center. How can I store the offset of the initial touch so that if I start the touch/drag to the side my finger will stay on that spot while I drag it around?

Was it helpful?

Solution

You can store target_view.frame in an instance variable when touchBegan message arrives.

OTHER TIPS

Can't you store that in an instance variable of your class?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top