KYDrawerControllerを使用すると、次のように実装できます。
class MainViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
view.backgroundColor = UIColor.whiteColor()
title = "MainViewController"
navigationItem.leftBarButtonItem = UIBarButtonItem(
title: "Open",
style: UIBarButtonItemStyle.Plain,
target: self,
action: "didTapOpenButton:"
)
}
func didTapOpenButton(sender: UIBarButtonItem) {
if let drawerController = navigationController?.parentViewController as? KYDrawerController {
drawerController.setDrawerState(.Opened, animated: true)
}
}
}
https://github.com/ykyouhei/KYDrawerController/tree/master/Example/Code