使用SWRevealViewController控制器时如何注销?

时间:2018-05-05 11:36:18

标签: ios swift xcode swrevealviewcontroller

我在我的应用程序中使用SWRevealViewController ..我首先登录屏幕我的应用程序..登录按钮单击我加载前视图控制器和左侧栏(使用SWRevealViewController)但如何在注销按钮上从SWRevealViewController注销单击并转到登录界面..?我无法退出..

以下是登录按钮上的代码点击..

    let frontNavigationController:UINavigationController
    let rearNavigationController:UINavigationController

    let revealController = SWRevealViewController()
    var mainRevealController = SWRevealViewController()

    let storyboard = UIStoryboard(name: "Main", bundle: nil)
    let sidebar = storyboard.instantiateViewController(withIdentifier:  "MenuTableView")as! MenuTableView
    let homepage = storyboard.instantiateViewController(withIdentifier: "Map_VC") as! MapViewController
    frontNavigationController =  UINavigationController(rootViewController: homepage)
    rearNavigationController = UINavigationController(rootViewController: sidebar)

    revealController.frontViewController = frontNavigationController
    revealController.rearViewController = rearNavigationController
    revealController.delegate = self
    mainRevealController  = revealController
    self.window?.rootViewController = mainRevealController

    UINavigationBar.appearance().barTintColor = UIColor(red: 235.0/255, green: 113.0/255, blue: 158.0/255, alpha: 1.0)
    UINavigationBar.appearance().tintColor = UIColor.white

1 个答案:

答案 0 :(得分:0)

试试这个:

 let goNext = storyBoard.instantiateViewController(withIdentifier: "storyboardID") 
 let customNavigation = UINavigationController(rootViewController: goNext!)
 self.present(customNavigation, animated: true, completion: nil)