Open
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!
Metadata
Assignees
Labels
No labels
Activity