As the title states, how do you hide/show a tab in a tab bar where a tab bar controller is programmatically?
Or is there a better way to do this, since I want to show a certain tab containing a certain view depending on the user that logs in.
Assuming that you have a subclass of UITabBarController:
final class YourSubClass: UITabBarController {
override func viewDidLoad() {
super.viewDidLoad()
viewControllers?.remove(at: 0) // remove the first tab, tab index starts with 0
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With