问题
Toggle not working in swipeMenu...when using SWRevealViewController library.. ihave been following these tutorial
http://www.appcoda.com/sidebar-menu-swift/
Here is the project : https://drive.google.com/file/d/0B6dTvD1JbkgBUmJ3SmNYeFdvOHM/view?usp=sharing
回答1:
Hey i found the bug in your project the Left menu is not allocated,Try changing the Menu Controller and don't attach the segues for cell.Just Change the Menucontroller and try, it is working For cell segues you can call programmatically in tableviewdidselectrowatindexpath
here is link i have modified your code
https://drive.google.com/file/d/0B0pjD3FrutBsV3JiTDZ6aVAyWkE/view?usp=sharing
For eg:
UINavigationController *navController = [self.storyboard instantiateViewControllerWithIdentifier:@"pager"];
[self.revealViewController setFrontViewController:navController animated:YES];
回答2:
Try 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
Don't forget to set the delegate.
To toggle you can use
self.revealViewController().revealToggleAnimated(true)
and to push new ViewController
var nav = UINavigationController(rootViewController: vc!)
self.revealViewController().pushFrontViewController(nav, animated: true)
来源:https://stackoverflow.com/questions/30236357/swipeout-menu-not-working-while-using-swreveal-library