Swipeout Menu not working while using SWReveal Library

≯℡__Kan透↙ 提交于 2019-12-24 04:16:29

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!