|
|
|
@ -40,17 +40,20 @@ class TicketsCoordinator: NSObject, Coordinator { |
|
|
|
|
let tokensStorage: TokensDataStore |
|
|
|
|
let navigationController: UINavigationController |
|
|
|
|
var coordinators: [Coordinator] = [] |
|
|
|
|
var ethPrice: Subscribable<Double> |
|
|
|
|
|
|
|
|
|
init( |
|
|
|
|
session: WalletSession, |
|
|
|
|
navigationController: UINavigationController = NavigationController(), |
|
|
|
|
keystore: Keystore, |
|
|
|
|
tokensStorage: TokensDataStore |
|
|
|
|
tokensStorage: TokensDataStore, |
|
|
|
|
ethPrice: Subscribable<Double> |
|
|
|
|
) { |
|
|
|
|
self.session = session |
|
|
|
|
self.keystore = keystore |
|
|
|
|
self.navigationController = navigationController |
|
|
|
|
self.tokensStorage = tokensStorage |
|
|
|
|
self.ethPrice = ethPrice |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func start() { |
|
|
|
@ -150,14 +153,14 @@ class TicketsCoordinator: NSObject, Coordinator { |
|
|
|
|
viewController.navigationController?.pushViewController(vc, animated: true) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private func showQuantityViewController(for ticketHolder: TicketHolder, |
|
|
|
|
in viewController: RedeemTicketsViewController) { |
|
|
|
|
private func showEnterQuantityViewController(for ticketHolder: TicketHolder, |
|
|
|
|
in viewController: RedeemTicketsViewController) { |
|
|
|
|
let quantityViewController = makeRedeemTicketsQuantitySelectionViewController(for: ticketHolder) |
|
|
|
|
viewController.navigationController?.pushViewController(quantityViewController, animated: true) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private func showQuantityViewController(for ticketHolder: TicketHolder, |
|
|
|
|
in viewController: SellTicketsViewController) { |
|
|
|
|
private func showEnterPriceQuantityViewController(for ticketHolder: TicketHolder, |
|
|
|
|
in viewController: SellTicketsViewController) { |
|
|
|
|
let vc = makeEnterSellTicketsPriceQuantityViewController(for: ticketHolder, paymentFlow: viewController.paymentFlow) |
|
|
|
|
viewController.navigationController?.pushViewController(vc, animated: true) |
|
|
|
|
} |
|
|
|
@ -193,7 +196,7 @@ class TicketsCoordinator: NSObject, Coordinator { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private func makeEnterSellTicketsPriceQuantityViewController(for ticketHolder: TicketHolder, paymentFlow: PaymentFlow) -> EnterSellTicketsPriceQuantityViewController { |
|
|
|
|
let controller = EnterSellTicketsPriceQuantityViewController(storage: tokensStorage, paymentFlow: paymentFlow) |
|
|
|
|
let controller = EnterSellTicketsPriceQuantityViewController(storage: tokensStorage, paymentFlow: paymentFlow, ethPrice: ethPrice) |
|
|
|
|
let viewModel = EnterSellTicketsPriceQuantityViewControllerViewModel(ticketHolder: ticketHolder) |
|
|
|
|
controller.configure(viewModel: viewModel) |
|
|
|
|
controller.delegate = self |
|
|
|
@ -239,8 +242,8 @@ class TicketsCoordinator: NSObject, Coordinator { |
|
|
|
|
return controller |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private func showQuantityViewController(for ticketHolder: TicketHolder, |
|
|
|
|
in viewController: TransferTicketsViewController) { |
|
|
|
|
private func showEnterQuantityViewController(for ticketHolder: TicketHolder, |
|
|
|
|
in viewController: TransferTicketsViewController) { |
|
|
|
|
let quantityViewController = makeTransferTicketsQuantitySelectionViewController(for: ticketHolder, paymentFlow: viewController.paymentFlow) |
|
|
|
|
viewController.navigationController?.pushViewController(quantityViewController, animated: true) |
|
|
|
|
} |
|
|
|
@ -354,7 +357,7 @@ extension TicketsCoordinator: TicketsViewControllerDelegate { |
|
|
|
|
|
|
|
|
|
extension TicketsCoordinator: RedeemTicketsViewControllerDelegate { |
|
|
|
|
func didSelectTicketHolder(ticketHolder: TicketHolder, in viewController: RedeemTicketsViewController) { |
|
|
|
|
showQuantityViewController(for: ticketHolder, in: viewController) |
|
|
|
|
showEnterQuantityViewController(for: ticketHolder, in: viewController) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func didPressViewInfo(in viewController: RedeemTicketsViewController) { |
|
|
|
@ -374,7 +377,7 @@ extension TicketsCoordinator: RedeemTicketsQuantitySelectionViewControllerDelega |
|
|
|
|
|
|
|
|
|
extension TicketsCoordinator: SellTicketsViewControllerDelegate { |
|
|
|
|
func didSelectTicketHolder(ticketHolder: TicketHolder, in viewController: SellTicketsViewController) { |
|
|
|
|
showQuantityViewController(for: ticketHolder, in: viewController) |
|
|
|
|
showEnterPriceQuantityViewController(for: ticketHolder, in: viewController) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func didPressViewInfo(in viewController: SellTicketsViewController) { |
|
|
|
@ -414,7 +417,7 @@ extension TicketsCoordinator: SetSellTicketsExpiryDateViewControllerDelegate { |
|
|
|
|
|
|
|
|
|
extension TicketsCoordinator: TransferTicketsViewControllerDelegate { |
|
|
|
|
func didSelectTicketHolder(ticketHolder: TicketHolder, in viewController: TransferTicketsViewController) { |
|
|
|
|
showQuantityViewController(for: ticketHolder, in: viewController) |
|
|
|
|
showEnterQuantityViewController(for: ticketHolder, in: viewController) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func didPressViewInfo(in viewController: TransferTicketsViewController) { |
|
|
|
|