2016-12-27 43 views
0

StoryBoard click here 這是我的故事板的側面菜單不起作用

我建設有SWRevealViewController側菜單中的打印,但它不就是後我的主視圖工作登錄場景,我將SWRevealViewController視圖與登錄和菜單連接起來,我也嘗試用主視圖創建一個segue,但沒有任何反應。

我在mainviewcontroller和按鈕不起作用的實現代碼

 if self.revealViewController() != nil { 
     menuBtn.target = self.revealViewController() 
     menuBtn.action = #selector(SWRevealViewController.revealToggle(_:)) 
     self.view.addGestureRecognizer(self.revealViewController().panGestureRecognizer()) 
    } 

回答

0

找到了解決辦法,我不得不這樣做登錄的SEGUE以這種方式MAINVIEW:

let storyboard = UIStoryboard(name: "Main", bundle: nil) 

let sw = storyboard.instantiateViewControllerWithIdentifier("SWRevealViewController") as! SWRevealViewController 

self.view.window?.rootViewController = sw 

let destinationController = self.storyboard?.instantiateViewControllerWithIdentifier("StoryboardID") as! NameOfViewController 

let navigationController = UINavigationController(rootViewController: destinationController) 

sw.pushFrontViewController(navigationController, animated: true)