diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/ViewExtensions.swift b/ui/BankingiOSApp/BankingiOSApp/ui/ViewExtensions.swift index cf2fc63f..e1cc8466 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/ViewExtensions.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/ViewExtensions.swift @@ -9,4 +9,13 @@ extension View { .navigationBarTitle("Title") } -} \ No newline at end of file +} + + +extension Alert.Button { + + public static func ok(_ action: (() -> Void)? = {}) -> Alert.Button { + return .default(Text("OK"), action: action) + } + +} diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/views/AddAccountDialog.swift b/ui/BankingiOSApp/BankingiOSApp/ui/views/AddAccountDialog.swift index 0ddd1833..1b8b1710 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/views/AddAccountDialog.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/views/AddAccountDialog.swift @@ -45,7 +45,7 @@ struct AddAccountDialog: View { } } .alert(item: $errorMessage) { message in - Alert(title: message.title, message: message.message, dismissButton: Alert.Button.cancel())) + Alert(title: message.title, message: message.message, dismissButton: .ok()) } .navigationBarTitle(Text("Add account"), displayMode: NavigationBarItem.TitleDisplayMode.inline) } @@ -84,4 +84,4 @@ struct AddAccountDialog_Previews: PreviewProvider { static var previews: some View { AddAccountDialog() } -} \ No newline at end of file +}