For removing a ViewController from tabBarController?
you should simply implement:
tabBarController?.viewControllers?.removeLast()
Assuming that you remove the last controller (tab).
It is related to viewControllers:
An array of the root view controllers displayed by the tab bar
interface.
Obviously, you could remove and controller, for instance, for removing the first controller:
tabBarController?.viewControllers?.remove(at: 0)
Update:
First I need the open Fifth viewcontroller and I'll not show it in
tabbar. User can't go fifth tabbar. Only I can navigate user. So cause
of that I'm trying to do that.
For achieving this, all you should do is to let your storyboard to be structured as:
Considering that the first view controller (the one that should present the tabbar controller) is the view controller that you don't want to let it appears in the tabbar.