SideMenu: Application crashes after touch home button

Application crashes for me after touching home button.In SideMenuTransition.hideMenuStart() SideMenuTransition.viewControllerForPresentedMenu! controller is nil. My init looks like:

 let leftViewController:UISideMenuNavigationController = UIStoryboard(name: "Main", bundle: nil).instantiateViewControllerWithIdentifier("UISideMenuNavigationController") as! UISideMenuNavigationController
         SideMenuManager.menuLeftNavigationController = leftViewController
        SideMenuManager.menuAddScreenEdgePanGesturesToPresent(toView: self.view)
        SideMenuManager.menuPresentMode = .MenuSlideIn
        SideMenuManager.menuAnimationBackgroundColor = UIColor.clearColor()

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 21 (11 by maintainers)

Most upvoted comments

Hi @jonkykong, I think you are right. I put a check like this

        if (SideMenuManager.menuLeftNavigationController == nil) {
            SideMenuManager.menuLeftNavigationController = storyboard!.instantiateViewControllerWithIdentifier("LeftMenuNavigationController") as? UISideMenuNavigationController
        }

in my frontview controller And everything is fine. So I’m closing this issue. Thank you very much for your support 👍

I’m sorry for not reading your reply carefully. The exception is the same as the first post. In internal class func hideMenuStart() , SideMenuTransition.viewControllerForPresentedMenu! controller is nil. and it crashes. I just comment out SideMenuManager.menuLeftNavigationController = storyboard!.instantiateViewControllerWithIdentifier("LeftMenuNavigationController") as? UISideMenuNavigationController in my menu init and it doesn’t crash anymore