I have a view controller which contains a scrollview, which takes up the whole available window. There is a UIView which I use as a container view, which is a subview of the scrollview, and contains all the other views and controls. There is a lot of configuration when the view controller is initialized, as to what view(s) and control(s) will be displayed, depending on the data from the web service.
Attached to the main view of the view controller is a tap gesture recognizer. I've found that I need to check [touch view] to see if it is either a button or any other control that I don't want the gesture recognizer to interpret, and pass a NO value back from the
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch
delegate method if it is once of these controls.
So in this container view is another (UIView ) subview, and in that subview is a button. The view controller is part of a navigation controller stack, and all works well when this is presented as simply a navigation controller.
When the navigation controller is presented from one tab of a tab bar, then when I tap the button it isn't recognizing the tap on that button. When I break in the delegate method above, [touch view] is a UIView, and not a UIButton.
If I tap and hold on the button for a second or so, then it does recognize the button, and forwards the message to the button.
Any thoughts on this? I can post code, just not sure what to post yet...