I have the following setup in my iPhone project (a UIButton that has a UIView as sub-view):
- UIButton // super-view <-------|
| <touch-event>
|_ UIView // sub-view ________|
I have connected an action (touch-up-inside) from my UIButton with IB to my view controller. But unfortunately the UIView prevents the OS to call the action method of my UIButton, since the UIView subview does not respond to touches and thus not forward to its super-view.
How can I forward the action event from UIView to the super-view UIButton ? So that the UIButton "thinks" that it has been touched although the sub-view was touched.
I already found these links, but they didn't help me:
Some code sample in Objective-C would be great!
Overriding (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event
in your UIView and always returning NO should do the trick.