-2

Example steps: -Post photo -Tap to add text: "Hello world" -When in editing still, press to drag text higher on the photo. -Leave editing mode with keyboard open. Then press to drag to another position. Then tap once on the text to enter editing mode again with keyboard open.

1 Answers1

0

Have a look at these methods

– touchesBegan:withEvent:
– touchesMoved:withEvent:
– touchesEnded:withEvent:
– touchesCancelled:withEvent:

In touchesBegan you can check, whether the touch occurred within your textfield. If so, you can change the center of the textfields frame in the touchesMoved method and set it to the location of the touch.

Also check out this question for more ideas: How to find out what view a touch event ended at?

Community
  • 1
  • 1
Atomix
  • 13,427
  • 9
  • 38
  • 46
  • You can also look at a UIPanGestureRecognizer - http://www.cocoanetics.com/2010/11/draggable-buttons-labels/ – Paulw11 Aug 07 '14 at 21:06