抽屉像谷歌的iOS材料设计

我想将Uber这样的导航抽屉实现到iOS(swift)中。 我将通过使用名为KYDrawerController的库来实现它。 https://github.com/ykyouhei/KYDrawerController

但是,它不能提供切换按钮,只能滑动动作。 以为我想实现显示导航抽屉的切换按钮,我不知道如何将这样的function添加到库中。 如果您知道如何将函数添加到库中,或者如何以其他方式实现我的目的(例如使用其他库),请告诉我。 谢谢你的好意。

Uber1 Uber2

使用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