0

我正在使用 ECSlidingViewController 进行菜单导航。我有一个选项注销,选择注销用户。当用户再次登录时,菜单栏将可见而不是隐藏。用于在注销选择时隐藏菜单栏的 Swift 代码。

import Foundation
import UIKit
import Parse

class MenuTableViewController: UITableViewController {
@IBAction func unwindToMenuViewController(segue: UIStoryboardSegue) {
}
override func viewDidLoad() {
    super.viewDidLoad()
}

override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
}
override func tableView(tableView: UITableView,   didSelectRowAtIndexPath indexPath: NSIndexPath) {
    if indexPath.row == 4 {
        PFUser.logOut()

        var loadLoginPage: UINavigationController = self.storyboard?.instantiateViewControllerWithIdentifier("LoginNavigationController")! as UINavigationController
        self.presentViewController(loadLoginPage, animated: false, completion: nil)
    }
}
}
4

2 回答 2

0
var slidingViewController: ECSlidingViewController = self.view.window?.rootViewController as! ECSlidingViewController  
slidingViewController.resetTopViewAnimated(true)
于 2015-09-03T10:29:06.657 回答
0

试试self.slidingViewController?.resetTopViewAnimated(true)。然后只需从当前顶视图中删除 ECSlidingViewController 的平移手势识别器并禁用任何可能打开菜单的按钮。

于 2015-09-03T05:04:32.233 回答