0
votes

I really need some help. My Tab bar is disappearing whenever i select one of the items from my Side Menu. I've created a Side Menu (with pods) but when I select one of the menu's items, the Tab bar disappears. My Tab bar is supposed to stay visible all the time with only 4 or 5 main view controllers. On my Side menu I want to access secondary View Controllers that are not visible on the Tab Bar, but I want to keep the Tab bar visible all the time with the main View Controllers which are the most important ones and I can access it easily.

I've tried several codes but nothing works. I could use some help with this. I think the problem is the instantiation or the presentation of the Secondary VC (Configurations). Thanks in advance

On a separate file I've created a Class Constants where I'll setup my list of items for the menu:

struct Constants {
    
    
    //Storyboards
    struct Storyboard {
        
        static let Configurations = "Configurations"
        

    }
    
    //Menu list
    enum sideMenuItems: String, CaseIterable {
        case config = "Configurations"
        

    }
}

Then on the Main view controller, I've setup a button that slides the Menu from the left and i've coded the Menu's button tapping like this:

private var sideMenu: SideMenuNavigationController?

func didSelectMenuItem(named: Constants.sideMenuItems) {
        sideMenu?.dismiss(animated: true, completion: { [weak self] in
            
        switch named {
        case .config:
            let Configurations = self?.storyboard?.instantiateViewController(withIdentifier: Constants.Storyboard.Configurations) as? Configurations
            
            
            self?.view.window?.rootViewController = Configurations
            self?.view.window?.makeKeyAndVisible()

            }
        })
    }

What is wrong with the code? I can I get the tab bar to stay visible?