diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/ViewExtensions.swift b/ui/BankingiOSApp/BankingiOSApp/ui/ViewExtensions.swift index e1cc8466..ca0afb2b 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/ViewExtensions.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/ViewExtensions.swift @@ -6,7 +6,13 @@ extension View { func hideNavigationBar() -> some View { return self .navigationBarHidden(true) - .navigationBarTitle("Title") + .navigationBarTitle("", displayMode: .inline) + } + + func showNavigationBarTitle(_ title: LocalizedStringKey, displayMode: NavigationBarItem.TitleDisplayMode = .inline) -> some View { + return self + .navigationBarHidden(false) + .navigationBarTitle(title, displayMode: displayMode) } } diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/views/AccountTransactionsDialog.swift b/ui/BankingiOSApp/BankingiOSApp/ui/views/AccountTransactionsDialog.swift index e7035dca..d995ac87 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/views/AccountTransactionsDialog.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/views/AccountTransactionsDialog.swift @@ -31,7 +31,7 @@ struct AccountTransactionsDialog: View { } } } - .navigationBarTitle(Text(title), displayMode: NavigationBarItem.TitleDisplayMode.inline) + .showNavigationBarTitle(LocalizedStringKey(title)) .navigationBarHidden(false) } } diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/views/AddAccountDialog.swift b/ui/BankingiOSApp/BankingiOSApp/ui/views/AddAccountDialog.swift index dbc53e60..b61176f0 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/views/AddAccountDialog.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/views/AddAccountDialog.swift @@ -47,7 +47,7 @@ struct AddAccountDialog: View { .alert(item: $errorMessage) { message in Alert(title: message.title, message: message.message, dismissButton: message.primaryButton) } - .navigationBarTitle(Text("Add account"), displayMode: NavigationBarItem.TitleDisplayMode.inline) + .showNavigationBarTitle("Add account") .navigationBarHidden(false) } diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/views/TransferMoneyDialog.swift b/ui/BankingiOSApp/BankingiOSApp/ui/views/TransferMoneyDialog.swift index f405b6bf..2b2c6099 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/views/TransferMoneyDialog.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/views/TransferMoneyDialog.swift @@ -121,7 +121,7 @@ struct TransferMoneyDialog: View { return Alert(title: message.title, message: message.message, dismissButton: message.primaryButton) } } - .navigationBarTitle("Transfer Money Dialog Title", displayMode: .inline) + .showNavigationBarTitle("Transfer Money Dialog Title") }