From 9fb41ee5586dc4bbac35c020c786f5c63815ebc9 Mon Sep 17 00:00:00 2001 From: Michael Scoff Date: Thu, 12 Oct 2017 21:29:51 -0700 Subject: [PATCH] Stop coordinator --- Trust/AppCoordinator.swift | 3 +++ Trust/Transactions/Coordinators/BalanceCoordinator.swift | 4 ++++ Trust/Transactions/Coordinators/TransactionCoordinator.swift | 5 +++++ 3 files changed, 12 insertions(+) diff --git a/Trust/AppCoordinator.swift b/Trust/AppCoordinator.swift index 1ce4ef369..04cd70a01 100644 --- a/Trust/AppCoordinator.swift +++ b/Trust/AppCoordinator.swift @@ -88,18 +88,21 @@ extension AppCoordinator: WelcomeViewControllerDelegate { extension AppCoordinator: TransactionCoordinatorDelegate { func didCancel(in coordinator: TransactionCoordinator) { coordinator.navigationController.dismiss(animated: true, completion: nil) + coordinator.stop() removeCoordinator(coordinator) reset() } func didChangeAccount(to account: Account, in coordinator: TransactionCoordinator) { coordinator.navigationController.dismiss(animated: true, completion: nil) + coordinator.stop() removeCoordinator(coordinator) showTransactions(for: account) } func didRestart(with account: Account, in coordinator: TransactionCoordinator) { coordinator.navigationController.dismiss(animated: true, completion: nil) + coordinator.stop() removeCoordinator(coordinator) showTransactions(for: account) } diff --git a/Trust/Transactions/Coordinators/BalanceCoordinator.swift b/Trust/Transactions/Coordinators/BalanceCoordinator.swift index 49b2141c0..6870e8c20 100644 --- a/Trust/Transactions/Coordinators/BalanceCoordinator.swift +++ b/Trust/Transactions/Coordinators/BalanceCoordinator.swift @@ -62,6 +62,10 @@ class BalanceCoordinator { delegate?.didUpdate(viewModel: viewModel) } + + func stop() { + + } } extension BalanceCoordinator: ExchangeRateCoordinatorDelegate { diff --git a/Trust/Transactions/Coordinators/TransactionCoordinator.swift b/Trust/Transactions/Coordinators/TransactionCoordinator.swift index 6c4144405..52dfdc360 100644 --- a/Trust/Transactions/Coordinators/TransactionCoordinator.swift +++ b/Trust/Transactions/Coordinators/TransactionCoordinator.swift @@ -96,6 +96,11 @@ class TransactionCoordinator: Coordinator { navigationController.dismiss(animated: true, completion: nil) } + func stop() { + dataCoordinator.stop() + balanceCoordinator.stop() + } + deinit { NotificationCenter.default.removeObserver(self) }