From 70b8a8b84cff16965ddb91367baa51e5621f0f32 Mon Sep 17 00:00:00 2001 From: dankito Date: Sun, 26 Jul 2020 15:14:03 +0200 Subject: [PATCH] Fixed hide disclosure triangle for Bank- and BankAccountListItems (issue was that you have to use "ForEach(0 ..< array.count) { index in" instead of "ForEach(array) item in" - very obvious, Apple!) --- .../BankingiOSApp/ui/views/AccountsTab.swift | 4 ++-- .../BankingiOSApp/ui/views/BankAccountListItem.swift | 6 +++++- .../BankingiOSApp/ui/views/BankListItem.swift | 10 +++++++--- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/views/AccountsTab.swift b/ui/BankingiOSApp/BankingiOSApp/ui/views/AccountsTab.swift index 415f9dcb..9eea552c 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/views/AccountsTab.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/views/AccountsTab.swift @@ -13,8 +13,8 @@ struct AccountsTab: View { VStack { if data.banks.isEmpty == false { Form { - ForEach(data.banks) { bank in - BankListItem(bank: bank) + ForEach(0 ..< data.banks.count) { bankIndex in + BankListItem(bank: self.data.banks[bankIndex]) } } } diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/views/BankAccountListItem.swift b/ui/BankingiOSApp/BankingiOSApp/ui/views/BankAccountListItem.swift index aef3bee0..abfb8597 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/views/BankAccountListItem.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/views/BankAccountListItem.swift @@ -8,11 +8,15 @@ struct BankAccountListItem : View { var body: some View { - NavigationLink(destination: AccountTransactionsDialog(title: account.displayName, transactions: account.bookedTransactions)) { + ZStack { HStack { Text(account.displayName) Spacer() }.frame(height: 35) + + NavigationLink(destination: AccountTransactionsDialog(title: account.displayName, transactions: account.bookedTransactions)) { + EmptyView() + } } } diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/views/BankListItem.swift b/ui/BankingiOSApp/BankingiOSApp/ui/views/BankListItem.swift index f30625ee..896f4566 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/views/BankListItem.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/views/BankListItem.swift @@ -9,18 +9,22 @@ struct BankListItem : View { var body: some View { Section { - NavigationLink(destination: AccountTransactionsDialog(title: bank.displayName, transactions: bank.accounts.flatMap { $0.bookedTransactions })) { + ZStack { HStack { Text(bank.displayName) .font(.headline) Spacer() }.frame(height: 35) + + NavigationLink(destination: AccountTransactionsDialog(title: bank.displayName, transactions: bank.accounts.flatMap { $0.bookedTransactions })) { + EmptyView() + } } - ForEach(bank.accounts) { account in - BankAccountListItem(account: account) + ForEach(0 ..< bank.accounts.count) { accountIndex in + BankAccountListItem(account: self.bank.accounts[accountIndex]) } .padding(.leading, 18) }