Reputation: 1314
I have a view controller which contains container view controller.
I override touchesBegan function inside both
View Controller
Container View Controller
View controllers touch begin only called when tap outside the container view.
Container view controller touch begin never get called even clicked on container view.
My requirement is that whenever anywhere I tap on main view controller touch begin should be called.
How can I proceed for it?
Upvotes: 0
Views: 1380
Reputation: 408
It might be that something else is consuming your touches. If I understand your setup correctly, you have the SignupViewController inside ViewController. The SignupViewController has a scroll-view in it - I would assume that it is consuming the touches.
Managing touch event functions together with a scrollview is kind of tricky (but can be done). In my experience, UIGestureRecognizer (tap, pan etc - there are some subclasses) are much easier to work with.
Edit: Looked at some old code and simultaneous gesturerecognizers (i.e. scroll and your own) is possible but you need to explicitly allow it. See this answer
Upvotes: 1