diff --git a/ZWallet.xcodeproj/project.pbxproj b/ZWallet.xcodeproj/project.pbxproj index 5d3a015..f2877d2 100644 --- a/ZWallet.xcodeproj/project.pbxproj +++ b/ZWallet.xcodeproj/project.pbxproj @@ -66,6 +66,7 @@ EE76B85D21D8D1930093571F /* SourceSansPro-SemiBold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EE76B85021D8D1930093571F /* SourceSansPro-SemiBold.ttf */; }; EE76B85E21D8D1930093571F /* SourceSansPro-ExtraLightItalic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EE76B85121D8D1930093571F /* SourceSansPro-ExtraLightItalic.ttf */; }; EE76B85F21D8D1930093571F /* SourceSansPro-Italic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EE76B85221D8D1930093571F /* SourceSansPro-Italic.ttf */; }; + EE94A74C22135B7200882BB1 /* TrxDetailsVCDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE94A74B22135B7200882BB1 /* TrxDetailsVCDelegate.swift */; }; EEBEBB7521FF8DC800A6BD18 /* RecipientAddressVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEBEBB7421FF8DC800A6BD18 /* RecipientAddressVC.swift */; }; EEBEBB7721FF91B700A6BD18 /* RecipientAddressDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEBEBB7621FF91B700A6BD18 /* RecipientAddressDelegate.swift */; }; EEBEBB7821FF97AC00A6BD18 /* RecipientAddress.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = EEBEBB7221FF8B6D00A6BD18 /* RecipientAddress.storyboard */; }; @@ -163,6 +164,7 @@ EE76B85021D8D1930093571F /* SourceSansPro-SemiBold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SourceSansPro-SemiBold.ttf"; sourceTree = ""; }; EE76B85121D8D1930093571F /* SourceSansPro-ExtraLightItalic.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SourceSansPro-ExtraLightItalic.ttf"; sourceTree = ""; }; EE76B85221D8D1930093571F /* SourceSansPro-Italic.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SourceSansPro-Italic.ttf"; sourceTree = ""; }; + EE94A74B22135B7200882BB1 /* TrxDetailsVCDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TrxDetailsVCDelegate.swift; sourceTree = ""; }; EE96916F21D561BE00BE1289 /* Passphrase.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Passphrase.storyboard; sourceTree = ""; }; EEBEBB7221FF8B6D00A6BD18 /* RecipientAddress.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = RecipientAddress.storyboard; sourceTree = ""; }; EEBEBB7421FF8DC800A6BD18 /* RecipientAddressVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecipientAddressVC.swift; sourceTree = ""; }; @@ -294,6 +296,7 @@ children = ( EE377EEA21F7AF3C00138385 /* TrxDetailTableViewCell.swift */, EE377EE821F7A76500138385 /* TrxDetailsVC.swift */, + EE94A74B22135B7200882BB1 /* TrxDetailsVCDelegate.swift */, EE377EEC21F7B02600138385 /* TrxMemoTableViewCell.swift */, ); path = TrxDetails; @@ -671,6 +674,7 @@ EE377EE921F7A76500138385 /* TrxDetailsVC.swift in Sources */, EEBEBB7B2200DFC000A6BD18 /* ScanVC.swift in Sources */, EE576FFE21CFCC5500433CAB /* AppDelegate.swift in Sources */, + EE94A74C22135B7200882BB1 /* TrxDetailsVCDelegate.swift in Sources */, EE377EC021E7D92200138385 /* PinEntryMode.swift in Sources */, EE377EB721E6831E00138385 /* CreateNewWalletCoordinator.Delegate.swift in Sources */, EEBEBB7D2200E10B00A6BD18 /* ScanVCDelegate.swift in Sources */, diff --git a/ZWallet/Infrastructure/de.lproj/InfoPlist.strings b/ZWallet/Infrastructure/de.lproj/InfoPlist.strings index b593e5d..5a09d05 100644 --- a/ZWallet/Infrastructure/de.lproj/InfoPlist.strings +++ b/ZWallet/Infrastructure/de.lproj/InfoPlist.strings @@ -78,3 +78,9 @@ "amount.available" = "verfügbar"; +"memo.title" = "Memo (optional)"; + +"memo.memo.placeholder" = "Eingabe"; + +"memo.next" = "Weiter"; + diff --git a/ZWallet/Infrastructure/en.lproj/InfoPlist.strings b/ZWallet/Infrastructure/en.lproj/InfoPlist.strings index 751363a..9b5302c 100644 --- a/ZWallet/Infrastructure/en.lproj/InfoPlist.strings +++ b/ZWallet/Infrastructure/en.lproj/InfoPlist.strings @@ -78,3 +78,9 @@ "amount.available" = "available"; +"memo.title" = "Memo (optional)"; + +"memo.memo.placeholder" = "Start typing"; + +"memo.next" = "Next"; + diff --git a/ZWallet/Storyboards/Amount.storyboard b/ZWallet/Storyboards/Amount.storyboard index b3a9841..081930f 100644 --- a/ZWallet/Storyboards/Amount.storyboard +++ b/ZWallet/Storyboards/Amount.storyboard @@ -132,6 +132,9 @@ + + + @@ -175,6 +181,8 @@ + + diff --git a/ZWallet/Storyboards/Memo.storyboard b/ZWallet/Storyboards/Memo.storyboard index 51b3075..a5bfea2 100644 --- a/ZWallet/Storyboards/Memo.storyboard +++ b/ZWallet/Storyboards/Memo.storyboard @@ -24,7 +24,7 @@ - + @@ -98,6 +98,9 @@ + + + @@ -130,6 +136,8 @@ + + diff --git a/ZWallet/Storyboards/RecipientAddress.storyboard b/ZWallet/Storyboards/RecipientAddress.storyboard index da60e3c..130f375 100644 --- a/ZWallet/Storyboards/RecipientAddress.storyboard +++ b/ZWallet/Storyboards/RecipientAddress.storyboard @@ -137,6 +137,9 @@ + + + @@ -175,6 +181,8 @@ + + diff --git a/ZWallet/Storyboards/TrxDetails.storyboard b/ZWallet/Storyboards/TrxDetails.storyboard index 9a35f6f..0f2cc24 100644 --- a/ZWallet/Storyboards/TrxDetails.storyboard +++ b/ZWallet/Storyboards/TrxDetails.storyboard @@ -154,6 +154,9 @@ Memo 4 + + + @@ -172,6 +175,7 @@ Memo 4 + diff --git a/ZWallet/ViewCoordinators/HomeCoordinator.swift b/ZWallet/ViewCoordinators/HomeCoordinator.swift index 1fcf953..d807902 100644 --- a/ZWallet/ViewCoordinators/HomeCoordinator.swift +++ b/ZWallet/ViewCoordinators/HomeCoordinator.swift @@ -62,11 +62,13 @@ extension HomeCoordinator: HomeVCDelegate { self.registerForNewTrx() - let vc = self.viewFactory.getHomeView() - vc.delegate = self - vc.localizer = self.localizer - vc.trxHistory = self.trxHistoryProvider.all() - self.navigationController.pushViewController(vc, animated: true) + self.homeVC = self.viewFactory.getHomeView() + if let vc = self.homeVC { + vc.delegate = self + vc.localizer = self.localizer + vc.trxHistory = self.trxHistoryProvider.all() + self.navigationController.pushViewController(vc, animated: true) + } } private func showSend() { @@ -79,6 +81,7 @@ extension HomeCoordinator: HomeVCDelegate { private func showTrxDetailsView(for trxDetails: TrxDetails) { let vc = self.viewFactory.getTrxDetailsView() + vc.delegate = self vc.localizer = self.localizer vc.trxDetails = trxDetails self.navigationController.pushViewController(vc, animated: true) @@ -119,6 +122,14 @@ extension HomeCoordinator: HomeVCDelegate { } +extension HomeCoordinator: TrxDetailsVCDelegate { + + func trxDetailsVCDelegateBackTouched(sender: TrxDetailsVC) { + self.navigationController.popViewController(animated: true) + } +} + + extension HomeCoordinator: TrxHistoryObservable { func changed() { @@ -127,4 +138,15 @@ extension HomeCoordinator: TrxHistoryObservable { } -extension HomeCoordinator: SendCoordinatorDelegate {} +extension HomeCoordinator: SendCoordinatorDelegate { + + func sendCoordinatorSuccessful(coordinator: SendCoordinator) { + #warning("implement") + } + + func sendCoordinatorCancelled(coordinator: SendCoordinator) { + if let vc = self.homeVC { + self.navigationController.popToViewController(vc, animated: true) + } + } +} diff --git a/ZWallet/ViewCoordinators/SendCoordinator.swift b/ZWallet/ViewCoordinators/SendCoordinator.swift index cded153..5171b1e 100644 --- a/ZWallet/ViewCoordinators/SendCoordinator.swift +++ b/ZWallet/ViewCoordinators/SendCoordinator.swift @@ -54,6 +54,14 @@ extension SendCoordinator: RecipientAddressDelegate { self.showAmountView() } + func recipientAddressVCBackTouched(sender: RecipientAddressVC) { + self.navigationController.popViewController(animated: true) + } + + func recipientAddressVCCancelTouched(sender: RecipientAddressVC) { + self.delegate?.sendCoordinatorCancelled(coordinator: self) + } + private func showRecipientAddressView() { let vc = self.viewFactory.getRecipientAddressView() vc.delegate = self @@ -88,6 +96,14 @@ extension SendCoordinator: AmountVCDelegate { self.showMemoView() } + func amountVCDelegateBackTouched(sender: AmountVC) { + self.navigationController.popViewController(animated: true) + } + + func amountVCDelegateCancelTouched(sender: AmountVC) { + self.delegate?.sendCoordinatorCancelled(coordinator: self) + } + private func showAmountView() { let vc = self.viewFactory.getAmountView() vc.delegate = self @@ -106,6 +122,14 @@ extension SendCoordinator: MemoVCDelegate { #warning("implement") } + func memoVCDelegateBackTouched(sender: MemoVC) { + self.navigationController.popViewController(animated: true) + } + + func memoVCDelegateCancelTouched(sender: MemoVC) { + self.delegate?.sendCoordinatorCancelled(coordinator: self) + } + private func showMemoView() { let vc = self.viewFactory.getMemoVC() vc.delegate = self diff --git a/ZWallet/ViewCoordinators/SendCoordinatorDelegate.swift b/ZWallet/ViewCoordinators/SendCoordinatorDelegate.swift index 393b2db..1cd351a 100644 --- a/ZWallet/ViewCoordinators/SendCoordinatorDelegate.swift +++ b/ZWallet/ViewCoordinators/SendCoordinatorDelegate.swift @@ -9,4 +9,7 @@ import Foundation -internal protocol SendCoordinatorDelegate: class {} +internal protocol SendCoordinatorDelegate: class { + func sendCoordinatorSuccessful(coordinator: SendCoordinator) + func sendCoordinatorCancelled(coordinator: SendCoordinator) +} diff --git a/ZWallet/Views/Amount/AmountVC.swift b/ZWallet/Views/Amount/AmountVC.swift index 914e6e8..c559b56 100644 --- a/ZWallet/Views/Amount/AmountVC.swift +++ b/ZWallet/Views/Amount/AmountVC.swift @@ -10,6 +10,8 @@ import UIKit class AmountVC: UIViewController { + @IBOutlet weak var backButton: UIButton! + @IBOutlet weak var cancelButton: UIButton! @IBOutlet weak var progressBar: ZWProgressBar! @IBOutlet weak var titleLabel: UILabel! @IBOutlet weak var currencyLabel: UILabel! @@ -33,6 +35,14 @@ class AmountVC: UIViewController { self.delegate?.amountVCDelegateNextButtonTouched(sender: self, amount: zec) } + @IBAction func backButtonTouched() { + self.delegate?.amountVCDelegateBackTouched(sender: self) + } + + @IBAction func cancelButtonTouched() { + self.delegate?.amountVCDelegateCancelTouched(sender: self) + } + override func viewDidLoad() { super.viewDidLoad() self.setup() diff --git a/ZWallet/Views/Amount/AmountVCDelegate.swift b/ZWallet/Views/Amount/AmountVCDelegate.swift index 7d90148..2db4c46 100644 --- a/ZWallet/Views/Amount/AmountVCDelegate.swift +++ b/ZWallet/Views/Amount/AmountVCDelegate.swift @@ -12,4 +12,6 @@ import Foundation internal protocol AmountVCDelegate: class { func amountVCDelegateSendMaximumButtonTouched(sender: AmountVC) func amountVCDelegateNextButtonTouched(sender: AmountVC, amount: ZecInAtomicUnits) + func amountVCDelegateBackTouched(sender: AmountVC) + func amountVCDelegateCancelTouched(sender: AmountVC) } diff --git a/ZWallet/Views/Memo/MemoVC.swift b/ZWallet/Views/Memo/MemoVC.swift index cdfe9f1..ac020ee 100644 --- a/ZWallet/Views/Memo/MemoVC.swift +++ b/ZWallet/Views/Memo/MemoVC.swift @@ -10,6 +10,8 @@ import UIKit class MemoVC: UIViewController { + @IBOutlet weak var backButton: UIButton! + @IBOutlet weak var cancelButton: UIButton! @IBOutlet weak var progressBar: ZWProgressBar! @IBOutlet weak var titleLabel: UILabel! @IBOutlet weak var memoTextField: UITextField! @@ -23,6 +25,14 @@ class MemoVC: UIViewController { self.delegate?.memoVCDelegateNextButtonTouched(sender: self, memo: self.memoTextField.text) } + @IBAction func backButtonTouched() { + self.delegate?.memoVCDelegateBackTouched(sender: self) + } + + @IBAction func cancelTouched() { + self.delegate?.memoVCDelegateCancelTouched(sender: self) + } + override func viewDidLoad() { super.viewDidLoad() self.setup() diff --git a/ZWallet/Views/Memo/MemoVCDelegate.swift b/ZWallet/Views/Memo/MemoVCDelegate.swift index 8693557..da021ba 100644 --- a/ZWallet/Views/Memo/MemoVCDelegate.swift +++ b/ZWallet/Views/Memo/MemoVCDelegate.swift @@ -11,4 +11,6 @@ import Foundation internal protocol MemoVCDelegate: class { func memoVCDelegateNextButtonTouched(sender: MemoVC, memo: String?) + func memoVCDelegateBackTouched(sender: MemoVC) + func memoVCDelegateCancelTouched(sender: MemoVC) } diff --git a/ZWallet/Views/RecipientAddress/RecipientAddressDelegate.swift b/ZWallet/Views/RecipientAddress/RecipientAddressDelegate.swift index ce77ccf..acef641 100644 --- a/ZWallet/Views/RecipientAddress/RecipientAddressDelegate.swift +++ b/ZWallet/Views/RecipientAddress/RecipientAddressDelegate.swift @@ -13,4 +13,6 @@ internal protocol RecipientAddressDelegate: class { func recipientAddressVCScanButtonTouched(sender: RecipientAddressVC) func recipientAddressVCPasteFromClipboardButtonTouched(sender: RecipientAddressVC) func recipientAddressVCEnterManuallyButtonTouched(sender: RecipientAddressVC) + func recipientAddressVCBackTouched(sender: RecipientAddressVC) + func recipientAddressVCCancelTouched(sender: RecipientAddressVC) } diff --git a/ZWallet/Views/RecipientAddress/RecipientAddressVC.swift b/ZWallet/Views/RecipientAddress/RecipientAddressVC.swift index 69d15d4..11fdb7e 100644 --- a/ZWallet/Views/RecipientAddress/RecipientAddressVC.swift +++ b/ZWallet/Views/RecipientAddress/RecipientAddressVC.swift @@ -10,6 +10,8 @@ import UIKit class RecipientAddressVC: UIViewController { + @IBOutlet weak var backButton: UIButton! + @IBOutlet weak var cancelButton: UIButton! @IBOutlet weak var progressBar: ZWProgressBar! @IBOutlet weak var titelLabel: UILabel! @IBOutlet weak var descriptionLabel: UILabel! @@ -20,6 +22,14 @@ class RecipientAddressVC: UIViewController { public weak var delegate: RecipientAddressDelegate? public weak var localizer: Localizable? + @IBAction func backButtonTouched() { + self.delegate?.recipientAddressVCBackTouched(sender: self) + } + + @IBAction func cancelButtonTouched() { + self.delegate?.recipientAddressVCCancelTouched(sender: self) + } + @IBAction func scanCodeButtonTouched() { self.delegate?.recipientAddressVCScanButtonTouched(sender: self) } diff --git a/ZWallet/Views/TrxDetails/TrxDetailsVC.swift b/ZWallet/Views/TrxDetails/TrxDetailsVC.swift index 913ee3f..6f6f1c4 100644 --- a/ZWallet/Views/TrxDetails/TrxDetailsVC.swift +++ b/ZWallet/Views/TrxDetails/TrxDetailsVC.swift @@ -10,15 +10,21 @@ import UIKit class TrxDetailsVC: UIViewController { + @IBOutlet weak var backButton: UIButton! @IBOutlet weak var trxDirectionLabel: UILabel! @IBOutlet weak var amountLabel: UILabel! @IBOutlet weak var fiatAmountLabel: UILabel! @IBOutlet weak var headerView: UIView! @IBOutlet weak var detailsTableView: UITableView! + public weak var delegate: TrxDetailsVCDelegate? public weak var localizer: Localizable? public var trxDetails: TrxDetails? + @IBAction func backButtonTouched() { + self.delegate?.trxDetailsVCDelegateBackTouched(sender: self) + } + override func viewDidLoad() { super.viewDidLoad() diff --git a/ZWallet/Views/TrxDetails/TrxDetailsVCDelegate.swift b/ZWallet/Views/TrxDetails/TrxDetailsVCDelegate.swift new file mode 100644 index 0000000..6823b30 --- /dev/null +++ b/ZWallet/Views/TrxDetails/TrxDetailsVCDelegate.swift @@ -0,0 +1,14 @@ +// +// TrxDetailsVCDelegate.swift +// ZWallet +// +// Created by loj on 12.02.19. +// Copyright © 2019 XMR Systems LLC. All rights reserved. +// + +import Foundation + + +internal protocol TrxDetailsVCDelegate: class { + func trxDetailsVCDelegateBackTouched(sender: TrxDetailsVC) +}