views:

65

answers:

1

Hey all!

Concept is that a user taps on an icon in a view, a copy of the icon pops up under the user's finger, and they can drag it around until they lift their finger. To do this, I desire the following

  1. icon has touch event
  2. add transparent whole screen UIView and paste a UIImageView containing the icon on it.
  3. track touchMoves or a uiPanGestureRecognizer and move the UIImageView until touch up

The problem is that the touchMoves (and uiPanGestureRecognizer) don't track until the user lifts his finger and puts it back down. i.e. what's happening is:

  1. icon has touch event
  2. add transparent whole screen UIView and add a UIImageView subview containing the icon on it.
  3. user drags finger and nothing happens, so they lift finger and drag again
  4. track touchMoves or a uiPanGestureRecognizer and move the UIImageView until touch up

Apparently, for a UIView to recognize a drag, it seems to have to originate within the UIView. I tried (naively) to just send the touchdown event to the transparent view, but it isn't working.

Any other ideas?

many thanks...

+1  A: 

As far as I can tell, you can't start a drag with any view other than the one the drag was initiated on. For those that have access, take a look at the autoscroll WWDC 2010 project. They basically start a drag on the table cell's view and then allow you to drag that TableCell off the tableview. It works well and will probably be the route I'll be taking.

Oldmicah