I am developing a game that has a control layer that sits on top of every other layer, it needs to detect gestures which is fine I have that working, but the problem I am having is in order to detect gestures I need to use ccBeganTouch and ccEndedTouch and I can't return kEventIgnored for ccBeganTouch because it will prevent ccEndedTouch from firing with the new TouchDispatcher. Additionally, I must rely on the ccEndedTouch to fire and only then do I know if its the proper gesture, but by that time the ccBeganTouch has propagated down the chain and I can't intercept it. Now I have a solution, for all of my Layers in my application to inherit from a customized Layer class, where I will have a couple of boolean methods that will determine if a gesture is in progress and each layer will check these methods in their own corresponding touch events.
My problem with this is, its a lot of code duplication, and kind of a hack... Anyone know of a better way?