开发者

Catching UIGestureRecognizer only on the parent view

I Have two view contr开发者_如何学编程ollers that can hold the same component as a subView.

The component implements handling UIDragGestureRecognizer.

Controller A also handles drag gestures and should override the default drag behavior of the component.

So the problem is that if the component is a subView of controller B than i want the component to catch drag events, but if it's a subView of controller A than i don't want it to catch drag events.

Adding a UIDragGestureRecognizer to controllerA.view causes both the controller and the component to receive the drag event which is bad for me.

How can I make sure that the component will not receive drag events if it's a subView of controller A? (I'm adding the UIGestureRecognizer to the component at initialization and at that time i still don't know which controller will hold it).


[component removeGestureRecognizer:component.myGestureRecognizer];

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜