i'm new in ios development.
I use SWRevealViewController to add back side menu in my app. I want to add back button to each view in Menu. When I tap on the back button, I want to always go to initial(MainTabbedView) view.
Ui flow :
-->MainTabbedVIew-->(toggle_menu)-->(select Item1)-->Item 1-->(Back pressed)-->MainTabbedView
I found a similar question , ios SWRevealViewController pop from rear to front, but it is still has no answer.
I added a button to view and write some code :
@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)
}
It works, but controller always recreated, for example: in TabBarController selected tab always resets.
I want to add NavigationController behavior(pop previous view) to SWRevealViewController menu items.
My storyboard: https://i.stack.imgur.com/MW4Rw.png