I am trying to change the title of the tab item through the below code where I have to write that code in awakeFormNib() however due to some circumstances, I have to change the title in viewdidLoad(). I am using Swift.
override func awakeFromNib() {
self.title = NSLocalizedString("Hello World", tableName: "xxx", comment: "");
}
I did it using the below code in viewdidload()
if let downcastStrings = self.tabBarController?.tabBar.items as? [UITabBarItem]
{
downcastStrings[0].title = "Hi"
}
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