Tabbar items language can not change

Hello Guys,

I have interesting problem. I am trying to change tabbar item languages when the user select a different language, the tabbar item language should automatically. But my methods do not work under viewWillAppear method.

But If I add my methods under the didSelect tabbar delegate methods and click it, tabbar items update languages.

Here is my code block

override func viewWillAppear(_ animated: Bool) {
    super.viewWillAppear(animated)
    
    viewControllers = loadViewControllerList()
    VHURLRouter.instance.tabBar = self
    hideTabTitlesAndPositionIcons()
    
    setupAppearance()
}

Do you have any idea ?

Thanks

I don’t think you are guaranteed that viewWillAppear will be called. See NSCurrentLocaleDidChangeNotification in the Apple Docs

Thank you, I followed these instructions. ios - how to change uiviewcontroller title independent of tabbar item title - Stack Overflow

This topic was automatically closed after 166 days. New replies are no longer allowed.