From ad99badf276d7ac10083ab4fb043770e8dda1648 Mon Sep 17 00:00:00 2001 From: Oguzhan Gungor Date: Wed, 7 Mar 2018 11:21:11 +1000 Subject: [PATCH] Moving navbar button in TicketsViewController --- .../ViewControllers/RedeemTickets.storyboard | 2 +- .../TicketsViewController.swift | 27 ++++++++++++++----- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/Trust/Redeem/ViewControllers/RedeemTickets.storyboard b/Trust/Redeem/ViewControllers/RedeemTickets.storyboard index 347604344..5f10861a1 100644 --- a/Trust/Redeem/ViewControllers/RedeemTickets.storyboard +++ b/Trust/Redeem/ViewControllers/RedeemTickets.storyboard @@ -39,7 +39,7 @@ - + diff --git a/Trust/Tokens/ViewControllers/TicketsViewController.swift b/Trust/Tokens/ViewControllers/TicketsViewController.swift index 8514eb516..9d39afe6c 100644 --- a/Trust/Tokens/ViewControllers/TicketsViewController.swift +++ b/Trust/Tokens/ViewControllers/TicketsViewController.swift @@ -27,24 +27,39 @@ class TicketsViewController: UIViewController { var session: WalletSession! weak var delegate: TicketsViewControllerDelegate? - override func viewWillAppear(_ animated: Bool) { + override + func viewDidLoad() { + super.viewDidLoad() + navigationItem.leftBarButtonItem = UIBarButtonItem(barButtonSystemItem: .cancel, + target: self, + action: #selector(didTapCancelButton)) + } + + override + func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) self.navigationController?.applyTintAdjustment() + title = viewModel.title } - @IBAction func didTapDoneButton(_ sender: UIBarButtonItem) { + @IBAction + func didTapCancelButton(_ sender: UIBarButtonItem) { delegate?.didCancel(in: self) } - @IBAction func didPressRedeem(_ sender: UIButton) { - delegate?.didPressRedeem(token: viewModel.token, in: self) + @IBAction + func didPressRedeem(_ sender: UIButton) { + delegate?.didPressRedeem(token: viewModel.token, + in: self) } - @IBAction func didPressSell(_ sender: UIButton) { + @IBAction + func didPressSell(_ sender: UIButton) { delegate?.didPressSell(token: viewModel.token, in: self) } - @IBAction func didPressTransfer(_ sender: UIButton) { + @IBAction + func didPressTransfer(_ sender: UIButton) { delegate?.didPressTransfer(for: .send(type: .stormBird(viewModel.token)), ticketHolders: viewModel.ticketHolders!, in: self)