From 5d88e51ab95755553d4202731ff04ff360511a05 Mon Sep 17 00:00:00 2001 From: dankito Date: Mon, 24 Aug 2020 12:18:47 +0200 Subject: [PATCH] Extracted --- ui/BankingiOSApp/BankingiOSApp/ui/ViewExtensions.swift | 4 ++++ .../BankingiOSApp/ui/views/AccountTransactionsDialog.swift | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/ViewExtensions.swift b/ui/BankingiOSApp/BankingiOSApp/ui/ViewExtensions.swift index 176b1819..6637b293 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/ViewExtensions.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/ViewExtensions.swift @@ -73,6 +73,10 @@ extension View { .detailForegroundColor() } + func systemGroupedBackground() -> some View { + return self.background(Color(UIColor.systemGroupedBackground)) + } + func styleAmount(amount: CommonBigDecimal) -> some View { let amountColor = amount.decimal.isPositive() ? Styles.PositiveAmountColor : Styles.NegativeAmountColor diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/views/AccountTransactionsDialog.swift b/ui/BankingiOSApp/BankingiOSApp/ui/views/AccountTransactionsDialog.swift index d4da9efe..119bca73 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/views/AccountTransactionsDialog.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/views/AccountTransactionsDialog.swift @@ -115,11 +115,11 @@ struct AccountTransactionsDialog: View { } } .frame(maxWidth: .infinity, minHeight: 40) - .background(Color(UIColor.systemGroupedBackground)) + .systemGroupedBackground() .listRowInsets(EdgeInsets()) } } - .background(Color(UIColor.systemGroupedBackground)) + .systemGroupedBackground() if showFetchAllTransactionsOverlay { VStack { @@ -144,7 +144,7 @@ struct AccountTransactionsDialog: View { } .frame(height: 40) .padding(.horizontal, 6) - .background(Color(UIColor.systemGroupedBackground)) + .systemGroupedBackground() } } .alert(item: $errorMessage) { message in