How to limit the touch events to only one view controller?
I am making something similar to ruzzle and in order to slide between the
letters (buttons) i am using touch events (touchBegan, touchMove,
touchEnded).
The application consists of two view controllers in one storyboard. The
fist one is for the main menu and the second for inGame screen and i
switch between them by using the storyboard id. Everything works perfectly
fine until you switch from the inGame view to the MainMenu view.
The problem is when you return to the main menu from the inGame screen,
the touch events are still active and this is an issue, because when you
touch anywhere on the screen the app crashes. This happens, because the
methods in the inGame view are called from the MainMenu view for some
reason. Is there anyway to limit the touch events only for the inGameView?
PS. The setUserInteraction:(BOOL) method is not an option in my case,
because you cannot press the buttons in the main menu anymore.
No comments:
Post a Comment