I am having the following setup:
I want to initiate the MenuViewController + the tabbar on bottom programmatically like this:
let storyboard = UIStoryboard(name: "Employee", bundle: nil)
let tabbarVC = storyboard.instantiateViewController(withIdentifier: "tabBar") as! UITabBarController
self.present(tabbarVC, animated: false, completion: nil)
Unfortunately instead of initiating the view, simply nothing happens. Any ideas?
After @Bozzo Game's comment, I have been able to find the solution to this problem.
The line
self.present(tabbarVC, animated: false, completion: nil)
has to be replaced with
UIApplication.shared.keyWindow?.rootViewController = tabbarVC
As the idea here was not to use present
to display the tabbarVC on top of the current one, but to change the rootViewController of the Window.