Use SWRevealViewController with TabBarController Swift 3

0

Good afternoon, I'm using this library to open a side menu:

  

link

Everything works correctly, opens and closes the menu correctly, I am also using a TabBar, it is staying like this:

So far so good, my query comes when for example I select an option from the table ("classic photos", "tiles", "tombstones" ..), what happens when I select one of those options is that it opens me a completely new view eliminating everything else, it eliminates the views of tabBar and everything.

This image is from my views:

Then, specifically, my query would be; How do I click on an option in the table ("classic photos", "tiles", "tombstones" ..) just replace the view without removing tabBar options or anything?

    
asked by Jorge Requez 02.08.2017 в 21:02
source

1 answer

0

If you need a new view to open without the tabBar disappearing, you have to open it as a push from a tabBar's own view.

You are trying to mix two types of menus that work differently.

The idea of the side menu is to have a different view for each of the menu options, and each of them with the integrated menu, making it seem that the menu is a static element.

The tabBar, which is native to iOS, keeps all its views, so you do not have to reload them when switching between them.

It is possible that once you open a side menu option you can return to tabBar with self.dismiss(animated: true, completion: nil) if they open as modal and with self.navigationController.popViewController(animated: true) if they are opened as push (this is not always necessary if it appears automatically in the navigation)

    
answered by 03.08.2017 в 08:31