使用SWRevealViewController库切换不能在swipeMenu中工作..我一直在关注这些教程
http://www.appcoda.com/sidebar-menu-swift/
这是项目: https://drive.google.com/file/d/0B6dTvD1JbkgBUmJ3SmNYeFdvOHM/view?usp=sharing
答案 0 :(得分:1)
嘿,我发现项目中的错误没有分配左菜单,请尝试更改菜单控制器,不要为细胞附加segue。只需更改Menucontroller并尝试,它正在工作 对于单元格segues,您可以在tableviewdidselectrowatindexpath
中以编程方式调用这里是我修改过代码的链接
https://drive.google.com/file/d/0B0pjD3FrutBsV3JiTDZ6aVAyWkE/view?usp=sharing
例如:
UINavigationController *navController = [self.storyboard instantiateViewControllerWithIdentifier:@"pager"];
[self.revealViewController setFrontViewController:navController animated:YES];
答案 1 :(得分:0)
试试yhis
var home = BrowseViewController(nibName: "HomeViewController", bundle: nil)
var left = LeftMenuViewController(nibName: "LeftMenuViewController", bundle: nil)
var nav1 = UINavigationController(rootViewController: home)
var revel = SWRevealViewController(rearViewController: left, frontViewController: nav1)
revel.delegate = self
revel.modalTransitionStyle = UIModalTransitionStyle.FlipHorizontal
window?.rootViewController = revel
不要忘记设置代理。
要切换,您可以使用
self.revealViewController().revealToggleAnimated(true)
并推送新的ViewController
var nav = UINavigationController(rootViewController: vc!)
self.revealViewController().pushFrontViewController(nav, animated: true)