How to pass a touch event to other views?

Posted by Eugene on Stack Overflow See other posts from Stack Overflow or by Eugene
Published on 2012-07-02T08:42:38Z Indexed on 2012/07/02 9:15 UTC
Read the original article Hit count: 207

Filed under:
|
|
|
+-----------------------+  +--------------------+
| A                     |  | A                  |
| +-------------------+ |  | +----------------+ |
| |B                  | |  | | C              | |
| |                   | |  | |                | |
| +-------------------+ |  | +----------------+ |
+-----------------------+  +--------------------+

I have a view hierarchy as above. (Each of B and C takes up whole space of A, Each of them are screen size. B is added first and C is added next)

For a reason, C is getting a touch event for scroll effect
(B is cocos2d-x layer and C(scroll view) sets the B's position when scrollViewDidScroll http://getsetgames.com/2009/08/21/cocos2d-and-uiscrollview/ )

And I want to pass touch event to B or it's subviews when it's not scrolling.

How can I pass the touch event to B here?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about ios