Search code examples
iosuiviewinteraction

Redirect all user interaction on UIView


I have a sliding side menu but it is possible for the user to interact with the non-menu view controller, as it is only slid over by about half the width.

I would like to keep user interaction enabled, but redirect all actions to the method that closes te menu.


Solution

  • You either can add a blurred / invisible view above the view the user should not interact with and add a touch recognizer to close the side menu or you add a touch recognizer to the view which only shoot the "close menu" action when the side menu is visible .