views:

33

answers:

1

Assembled elders of the Cocoa-Touch, I have a question for you all about Drag & Drop on the iPad.

I am attempting to drag an item from a popover onto an underlying canvas. Employing the UIPanGestureRecognizer class I can detect a drag-start and create a UIView to drag with the finger tip. My application runs in landscape mode.

The trouble comes when dragging across the tree of UIViews underneath: how can I find out what I am dragging across currently? When given [UIApplication sharedApplication].keyWindow, [UIView hitTest:withEvent:] always returns a UIDimmingView (that I didn't put there). If I pass a UIView that I've created to the hitTest call then I cannot detect a drop back onto the original popover - and therefore cannot detect a "don't drag after all" gesture.

Your clues and boos are most welcome.

M.

+1  A: 

"I am attempting to drag an item from a popover onto an underlying canvas."

Now that's cool, awesome idea!

Martin I may not understand your question, but would it be worth taking 30 seconds to:

simply try this using ordinary old touchesBegan/touchesMoved, and CGRectContainsPoint (or similar) to run through your views and see where it is at the moment....?

(Again unless I'm not understanding you, you can get "don't drag after all" in one line at touchesEnd, so that shouldn't be a problem.)

It would be interesting to see if it works using that simple old-fashioned approach.

(To be clear I am sure you are aware the UIDimmingView is put there by the OS, it's what makes the rest of the screen dim while you're popUp is onscreen.)

That is a great interface idea, I wonder if Apple will like it - have you seen a "drop-from-popover" before? Do you know a current example of it?

Joe Blow
Hello? Did you try this, any luck?
Joe Blow