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?
相关问题
- Image loads in simulator but not device?
- UIModalTransitionStyleFlipHorizontal flips Vertica
- Is it possible to hide a UIToolbar with an animati
- Xcode4 templates now use underscore on iVars?
- How can i associate an IBAction event with an imag
相关文章
- Xcode: Is there a way to change line spacing (UI L
- Can keyboard of type UIKeyboardTypeNamePhonePad be
- How to get a CGImageRef from Context-Drawn Images?
- Why are my UIView layer properties not being set w
- create UIImageView
- Can I add a border to an SKSpriteNode, similar to
- textFieldDidBeginEditing: for more than one textfi
- UIView subclass draws background despite completel
Can't you store that in an instance variable of your class?
You can store target_view.frame in an instance variable when touchBegan message arrives.