Stop coordinator

pull/2/head
Michael Scoff 7 years ago
parent 2cd4071e7c
commit 9fb41ee558
  1. 3
      Trust/AppCoordinator.swift
  2. 4
      Trust/Transactions/Coordinators/BalanceCoordinator.swift
  3. 5
      Trust/Transactions/Coordinators/TransactionCoordinator.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)
}

@ -62,6 +62,10 @@ class BalanceCoordinator {
delegate?.didUpdate(viewModel: viewModel)
}
func stop() {
}
}
extension BalanceCoordinator: ExchangeRateCoordinatorDelegate {

@ -96,6 +96,11 @@ class TransactionCoordinator: Coordinator {
navigationController.dismiss(animated: true, completion: nil)
}
func stop() {
dataCoordinator.stop()
balanceCoordinator.stop()
}
deinit {
NotificationCenter.default.removeObserver(self)
}

Loading…
Cancel
Save