Skip to content

Tabbar items customisation #119

Open
@PomazanovaAnna

Description

Hello!
I want to add localization on the fly for my project. However, I have @published property for the current language in custom TabCoordinator, which conforms TabCoordinatable. How can I update tab bar items each time when @published property is changed?
For now, tab bar items will change when the user press on some of them.

  final class AuthentificatedCoordinator: TabCoordinatable {
    
    @Route(tabItem: makeHomeTab) private var home = makeHomeCoordinator
    @Published var appLanguage: Language!

   }
@ViewBuilder
    func makeHomeTab(isActive: Bool) -> some View {
        Image(systemName: "house" + (isActive ? ".fill" : ""))
        Text("Home".localized(appLanguage)
    }

Thanks!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions