That’s tricky. I have a small button over a very big one. When the small button on that big button is pressed, the small button does something. But the big one does nothing. Of course. But now I want that the big button also does something, no matter if the small button was tapped or not. So the small button has to forward all touch events to that big button. What would be the easiest way to do it?
I know for UIView, but UIControl’s have their very own touch handling methods different from those of UIView. In UIView that could look somewhat like this:
[self.nextResponder touchesBegan:touches withEvent:event];
Might want to take a look at this post that shows ways to synthesize touch events. It stopped working for a while, though. Revisiting it just now it looks like he’s updated it for 3.0 support so it might work for you. A caveat is that it might not be legit for a shipping app.
An easier way is to break out the method that does the work (let’s call it
bigButtonWork) when the big button gets tapped and make it public. Then the big button tap handler just calls this routine. When the small button gets tapped you can choose inside its handler to do its own thing or callbigButtonWorkinstead.But I’m guessing you want it to simulate the big button actually getting pushed (complete with highlights and state changes) so you may have to go the synthesized event route.