From 293ab59eb6d823c398526b8c4b1d62052f689bb6 Mon Sep 17 00:00:00 2001 From: dankito Date: Sun, 26 Jul 2020 19:41:19 +0200 Subject: [PATCH] Added extensions detailForegroundColor() and styleAsDetail() --- .../BankingiOSApp/ui/ViewExtensions.swift | 11 +++++++++++ .../BankingiOSApp/ui/views/AddAccountDialog.swift | 4 ++-- .../BankingiOSApp/ui/views/BankInfoListItem.swift | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/ViewExtensions.swift b/ui/BankingiOSApp/BankingiOSApp/ui/ViewExtensions.swift index 8eb2bb04..f23f4a6c 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/ViewExtensions.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/ViewExtensions.swift @@ -32,6 +32,17 @@ extension View { }) } + func detailForegroundColor() -> some View { + return self + .foregroundColor(Color.gray) + } + + func styleAsDetail() -> some View { + return self + .font(.callout) + .detailForegroundColor() + } + } diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/views/AddAccountDialog.swift b/ui/BankingiOSApp/BankingiOSApp/ui/views/AddAccountDialog.swift index dbbc217a..c992b5c7 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/views/AddAccountDialog.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/views/AddAccountDialog.swift @@ -30,7 +30,7 @@ struct AddAccountDialog: View { } else { Text("Select your bank ...") - .foregroundColor(.gray) + .detailForegroundColor() .frame(height: 50) } } @@ -60,7 +60,7 @@ struct AddAccountDialog: View { .navigationBarHidden(false) } - + func isRequiredDataEntered() -> Bool { return bank != nil && customerId.isEmpty == false diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/views/BankInfoListItem.swift b/ui/BankingiOSApp/BankingiOSApp/ui/views/BankInfoListItem.swift index 21388f1c..b6a4ec73 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/views/BankInfoListItem.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/views/BankInfoListItem.swift @@ -26,7 +26,7 @@ struct BankInfoListItem: View { Spacer() } - .foregroundColor(.gray) + .styleAsDetail() .padding(.top, 6.0) } }