ios - Drag an image when touched on the object itself -
I have created a very simple app that has a draggable UIImageView but I have to face a problem that the image Can be drawn without touching. I'm sure the hole is from the issue Any ideas? Consider using the Pan gesture identifier. Add it to image view only (and enable user interaction on view). Now that you are visually touched, you will receive only action-driven callback from the gesture, your code will be simplified, and you can move the scene with that status. In addition, in your current code, it is weird to call anyObject , but I do not know how to change it, I tried
self.view.image but if it failed then here My code is
- (zero) touch: Brinjal: (NSSET *) touches with the event: (UIEVENT *) Event {UITTouch * Touch = [[Event All Tables] Any Object ]; CGPoint Location = [Touch Location Invoice: touch.view]; LineView.center = Location; } - Enhanced the touch (zero): (NSSET *) touches with the avant: (UIEVENT *) Event {{SP Touch Brinjal: App In Avenue: Event}; }
to touch: to
extended the touch: . If you keep that code (because you do not want to use the gesture), you should redistribute the code that moves the view to a different method and touches both
: And
touchesMoved: Call that method.
Comments
Post a Comment