我是新的ios開發。如何添加後退按鈕,這將彈出到前視圖,SWRevealViewController中的所有菜單項
我使用SWRevealViewController在我的應用程序中添加背面菜單。 我想向菜單中的每個視圖添加後退按鈕。 當我點擊後退按鈕時,我總想進入初始(MainTabbedView)視圖。
UI流量:
- > MainTabbedVIew - >(toggle_menu) - >(選擇項目1) - >第1項 - >(回到按下) - > MainTabbedView
我發現了一個類似的問題,ios SWRevealViewController pop from rear to front,但它仍然沒有答案。
我添加了一個按鈕來查看和寫一些代碼:
@IBAction func backPressed(sender: UIBarButtonItem) {
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let vc = storyboard.instantiateViewControllerWithIdentifier("mainTabbedScreen") as UIViewController!
self.revealViewController().pushFrontViewController(vc, animated: true)
}
它的工作原理,但控制器總是重新創建, 例如:在TabBarController所選標籤總是復位。
我想將NavigationController行爲(彈出前一個視圖)添加到SWRevealViewController菜單項。
我的故事板: http://i.imgur.com/kf5TlAR.png?1