Programmatically setting tabBarItem title in Swift

You can set the tab titles in the view controllers themselves in viewDidLoad by setting the view controller’s title property.

title = "Number 0"

Alternatively, if want to set the titles from your tab bar controller, you can set them like this in your tab bar controller’s viewDidLoad:

tabBar.items?[0].title = "Number 0"
tabBar.items?[1].title = "Number 1"

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)