Если вы хотите удалить UIViewController
из tabBar
, добавьте эту строку кода в UITabBarControllerClass
Для снятия
self.viewControllers?.remove(at: tabIndex) // replace the tabIndex which you want to remove
Для добавления
self.viewControllers?.insert(viewController, at: tabIndex) // replace the viewcontroller with your controller and tabIndex with your index