我在我的应用程序中使用了PKReveal,第一次我的右侧菜单打开但第二次变为零。请告诉我什么是错误。 我打开菜单的代码是:
class func displaySlideMenu(viewController:UIViewController)
{
if viewController.navigationController?.revealController.focusedController() == viewController.navigationController?.revealController.rightViewController
{
APP_DELEGATE.navigationController?.revealController.showViewController(viewController.navigationController?.revealController.frontViewController)
}else {
print(viewController.navigationController?.revealController.rightViewController)
APP_DELEGATE.navigationController?.revealController.showViewController(viewController.navigationController?.revealController.rightViewController)
}
}
设置显示控制器代码是:
let frontPageViewController = FrontPageViewController(nibName:"FrontPageViewController",bundle: nil)
APP_DELEGATE.navigationController = UINavigationController(rootViewController: frontPageViewController)
let rightMenuViewController = RightMenuViewController(nibName:"RightMenuViewController",bundle: nil)
APP_DELEGATE.revealController = PKRevealController(frontViewController: APP_DELEGATE.navigationController, rightViewController: rightMenuViewController)
APP_DELEGATE.window?.rootViewController = APP_DELEGATE.revealController
我的菜单第一次打开然后如果我关闭并尝试再次打开我的视图控制器正在打印nil。