From 338995e6718bbfcda0b258cab879354f594fed23 Mon Sep 17 00:00:00 2001 From: dankito Date: Fri, 31 Jul 2020 00:28:03 +0200 Subject: [PATCH] Fixed iterating over banks so that ForEach is able to handle dynamic changes (e.g. when an account got added) --- ui/BankingiOSApp/BankingiOSApp/ui/views/AccountsTab.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/views/AccountsTab.swift b/ui/BankingiOSApp/BankingiOSApp/ui/views/AccountsTab.swift index f09f2fd4..36dcc3a6 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/views/AccountsTab.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/views/AccountsTab.swift @@ -15,8 +15,8 @@ struct AccountsTab: View { Form { AllBanksListItem(banks: data.banks) - ForEach(0 ..< data.banks.count) { bankIndex in - BankListItem(bank: self.data.banks[bankIndex]) + ForEach(data.banks) { bank in + BankListItem(bank: bank) } } }