Reputation: 187
I'm using SWRevealViewController to have a sidebar menu in my app. It works great and hides whenever you touch outside of it, however, I want to be able to hide it if a user presses a UIButton inside the sidebar menu.
Any idea how to go about doing this? I assume I need an IBOutlet in my MenuViewController, but I have no idea what I would even do with it or how I would make it hide the menu.
Upvotes: 3
Views: 450
Reputation: 187
Okay never mind I solved it. I made an IBAction in my MenuViewController for the exit button, and inside I put:
self.revealViewController().revealToggle(animated: true)
Upvotes: 5