From 0133787ee4700dab3f0b9fee67c93779db793b67 Mon Sep 17 00:00:00 2001 From: dankito Date: Sat, 5 Sep 2020 02:03:29 +0200 Subject: [PATCH] Always displaying now transferMoneyAction, but disabling it if no accounts supporting transferring money are added --- ui/BankingiOSApp/BankingiOSApp/TabBarController.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/BankingiOSApp/BankingiOSApp/TabBarController.swift b/ui/BankingiOSApp/BankingiOSApp/TabBarController.swift index 5a81420f..f0f4b1e1 100644 --- a/ui/BankingiOSApp/BankingiOSApp/TabBarController.swift +++ b/ui/BankingiOSApp/BankingiOSApp/TabBarController.swift @@ -86,9 +86,9 @@ class TabBarController : UITabBarController, UITabBarControllerDelegate { private func showNewOptionsActionSheet() { let alert = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet) - if data.hasAccountsThatSupportTransferringMoney { - alert.addAction(UIAlertAction(title: "Show transfer money dialog".localize(), style: .default, handler: { _ in self.showView(TransferMoneyDialog()) })) - } + let transferMoneyAction = UIAlertAction(title: "Show transfer money dialog".localize(), style: .default, handler: { _ in self.showView(TransferMoneyDialog()) }) + transferMoneyAction.isEnabled = data.hasAccountsThatSupportTransferringMoney + alert.addAction(transferMoneyAction) alert.addAction(UIAlertAction(title: "Add account".localize(), style: .default, handler: { _ in self.showView(AddAccountDialog()) } )) alert.addAction(UIAlertAction(title: "Cancel".localize(), style: .cancel, handler: nil))