Try the following approach in your custom tab bar implementation (you will have to set it as a class of the tab bar controller in your storyboard):
class CustomTabBarController: UITabBarController {
override func awakeFromNib() {
super.awakeFromNib()
// I have no idea how you determine your user type, so fix it according to yourself
if user.type = "A" {
self.viewControllers = [storyboard!.instantiateViewController(withIdentifier: "ViewController1"),
storyboard!.instantiateViewController(withIdentifier: "ViewController2")]
} else {
self.viewControllers = [storyboard!.instantiateViewController(withIdentifier: "ViewController1"),
storyboard!.instantiateViewController(withIdentifier: "ViewController2"),
storyboard!.instantiateViewController(withIdentifier: "ViewController3")]
}
}
}