Gesture starts in one UIView, continues in another?
In brief: Is there a way to hand-off an in-progress drag gesture from one view to another?
More detail: I'm working on an iPad app. Imagine a situation where there's a playfield in the middle of the screen. On the borders are a bunch of "pieces" that can be dragged onto the playfield.
When one of the pieces is dragged onto the playfield, I want its appearance to change. Though it might be simplest if I had a single view that transformed its appearance when dragged onto the playfield, in my particular case, it's simpler if there is one view for the off-playfield appearance and another for the on-playfield appearance.
The trick is this: while I'm dragging the piece onto the field, I want the drag to continue on once I've gotten rid of my "off-playfield" view and added my "on-playfield" view. Essentially, I wa开发者_如何学运维nt to hand-off the gesture from one view to another, while the user goes through one continuous drag.
Is there a way to do this?
UPDATE: Actually got this working using the single-view approach, but am still curious as to whether a gesture hand-off can be done...
I think this isn't possible. What is possible is to have a parent view that contains the "before" view and "after" view. As the drag occurs, that parent view can switch between the two views while maintaining the drag.
精彩评论