开发者

Dragging Out of a Table and Responder Chain

I'm trying to build something where I can drag a person object from a UITableView into another UITableView. What I've got working so far is that when I select the item in the table to drag (UICustomTableViewCell), in the touchesMoved method, I pop the person object out of the cell and attach it to the superview. The problem that I seem to have is that as my finger keeps moving, the UITableView has captured the touch. It seems to be the dominant object. The entire table scrolls as a consequence and my person object that I want to move stays in one place. If I pick up my finger and grab the person object again, everything moves fine. This isn't a very elegant implementation since I have two grabs instead of one nice smooth movement开发者_StackOverflow中文版.

What I'm thinking the problem is, is that the UITableView is capturing the touch before the person object is and I somehow need to knock it out of the responder chain? I've tried setting the userInteractionEnabled to NO in the UICustomTableViewCell but no matter what, my person object is never the item that has the focus of the touch. Is there a way to do this?

Any suggestions are greatly appreciated. Thanks, mj


I figured out my own question. I needed overload the hittest method in the parent uiview. This way I can guide which uiview receives touch focus.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜