I created a menu for the iPhone, for which I used the concept of a container ship to add a child view controller to the parent view controller. When the user presses the menu button on the navigation bar, I just change the frame of the child view controller to animate it like a drop-down menu so that the child view controller cuts half of its frame to the right.
Now my problem is whenever a user clicks on any part of the child view controller, I just want to notify his parent view controller that touched the event fired on his child view controller so that the parent view controller can reset the child frame to animate it how to close half of the opened menu.
I used tap gestures and added it to the view of each child of the child views. therefore, a click gesture on any of the previews will notify the parent view controller of the touch event.
A touch event works fine for the main view of the child view controller, but any click on any button does not recognize the TAP event.
I do not know where I am wrong. please help me how to notify the parent view controller of any touches in its child view controller. Thanks in advance.
source share