Skip to content

Instantly share code, notes, and snippets.

@tsraveling
Last active July 25, 2017 15:46
Show Gist options
  • Save tsraveling/56a014a5e6a9623ba3a601c1b030f73b to your computer and use it in GitHub Desktop.
Save tsraveling/56a014a5e6a9623ba3a601c1b030f73b to your computer and use it in GitHub Desktop.
Slideout Menu

1. Add pod:

pod 'SWRevealViewController', '~> 2.3'

2. Set up storyboard:

  • Set up a SWRevealViewController as the parent VC
  • Custom reveal set segue to menu with id sw_rear
  • Custom reveal set segue to main view with id sw_front

3. Link the menu button

import SWRevealViewController

Then in viewDidLoad:

// Set up the menu
if let reveal_vc = self.revealViewController() {

    self.menuButton.addTarget(reveal_vc, action: #selector(SWRevealViewController.revealToggle(_:)), for: .touchUpInside)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment