你好,我已经在Swift中集成了SWRevealViewController。
下面是我在应用程序委托中编写的代码:
let frontView = ViewController(nibName: "ViewController", bundle: nil)
let rearView = LeftViewController(nibName : "LeftViewController", bundle :nil)
var frontNavigationController = UINavigationController(rootViewController: frontView)
var rearNavigationController = UINavigationController(rootViewController: rearView)
menuSlider = SWRevealViewController(rearViewController: rearNavigationController, frontViewController: frontNavigationController)
menuSlider?.delegate = self
let rightView = LeftViewController(nibName : "RightViewController", bundle :nil)
menuSlider?.rightViewController = rightView
self.window?.rootViewController = menuSlider
self.window?.backgroundColor = UIColor.whiteColor()
self.window?.makeKeyAndVisible()
在前端视图中,我已经写下了
var revealController:SWRevealViewController = self.revealViewController()
self.view.addGestureRecognizer(revealViewController().panGestureRecognizer())
self.view.addGestureRecognizer(revealViewController().tapGestureRecognizer())
如演示所示。我看到很多帖子建议在视图上添加手势。
我不确定我做错了什么。请帮我找到解决方案。
谢谢。