From 4b8307d619cf22d86d9f91cfa6794b831b5b4f6c Mon Sep 17 00:00:00 2001 From: InKwon James Kim Date: Thu, 29 Aug 2019 11:29:07 +0900 Subject: [PATCH] change error message when add, edit recipient --- GME Remit/Models/Response/SendMoneyReciept.swift | 1 - .../Service/SetupRecipientService.swift | 12 ++++++++++-- .../Wireframe/SetupRecipientWireframe.swift | 10 ++++++---- .../View/SendMoneyExchangeRateViewController.swift | 6 ++++-- 4 files changed, 20 insertions(+), 9 deletions(-) diff --git a/GME Remit/Models/Response/SendMoneyReciept.swift b/GME Remit/Models/Response/SendMoneyReciept.swift index c78faa43..1b8690c5 100644 --- a/GME Remit/Models/Response/SendMoneyReciept.swift +++ b/GME Remit/Models/Response/SendMoneyReciept.swift @@ -9,7 +9,6 @@ import Foundation import ObjectMapper - class SendMoneyReciept: Mappable { var controNo: String? var rFirstName: String? diff --git a/GME Remit/Modules/RecipientModules/SetupRecipient/Application Logic/Service/SetupRecipientService.swift b/GME Remit/Modules/RecipientModules/SetupRecipient/Application Logic/Service/SetupRecipientService.swift index 0c821c07..9899daf4 100644 --- a/GME Remit/Modules/RecipientModules/SetupRecipient/Application Logic/Service/SetupRecipientService.swift +++ b/GME Remit/Modules/RecipientModules/SetupRecipient/Application Logic/Service/SetupRecipientService.swift @@ -44,7 +44,11 @@ class SetupRecipientService: SetupRecipientServiceType { .request( success: {(response: ResponseContainerObject) in if response.errorCode != "0" { - let error = NSError(domain: "Network", code: 0, message: "Failed Add Recipient") + let error = NSError( + domain: "Network", + code: 0, + message: response.message ?? "Failed Add Recipient" + ) failure(error) } success(response) @@ -64,7 +68,11 @@ class SetupRecipientService: SetupRecipientServiceType { .request( success: {(response: ResponseContainerObject) in if response.errorCode != "0" { - let error = NSError(domain: "Network", code: 0, message: "Failed Edit Recipient") + let error = NSError( + domain: "Network", + code: 0, + message: response.message ?? "Failed Edit Recipient" + ) failure(error) } success(response) diff --git a/GME Remit/Modules/RecipientModules/SetupRecipient/User Interface/Wireframe/SetupRecipientWireframe.swift b/GME Remit/Modules/RecipientModules/SetupRecipient/User Interface/Wireframe/SetupRecipientWireframe.swift index 97cac75c..8fe56ff7 100644 --- a/GME Remit/Modules/RecipientModules/SetupRecipient/User Interface/Wireframe/SetupRecipientWireframe.swift +++ b/GME Remit/Modules/RecipientModules/SetupRecipient/User Interface/Wireframe/SetupRecipientWireframe.swift @@ -46,20 +46,22 @@ extension SetupRecipientWireframe: SetupRecipientWireframeInput { self.delegate = delegate let viewcontroller = getMainView() - let navigationViewController = UINavigationController( + let navigationController = UINavigationController( rootViewController: viewcontroller ) - base.present(navigationViewController, animated: true, completion: nil) + + base.present(navigationController, animated: true, completion: nil) } func openNew(with delegate: SetupRecipientDelegate, on base: UIViewController) { self.delegate = delegate let viewcontroller = getMainView() - let navigationViewController = UINavigationController( + let navigationController = UINavigationController( rootViewController: viewcontroller ) - base.present(navigationViewController, animated: true, completion: nil) + + base.present(navigationController, animated: true, completion: nil) } func openSelectMode(with model: [TablePresenterProtocol], type: SetupOpenType) { diff --git a/GME Remit/Modules/SendMoneyModules/SendMoneyExchangeRate/User Interface/View/SendMoneyExchangeRateViewController.swift b/GME Remit/Modules/SendMoneyModules/SendMoneyExchangeRate/User Interface/View/SendMoneyExchangeRateViewController.swift index df7cf249..a27c0cc6 100644 --- a/GME Remit/Modules/SendMoneyModules/SendMoneyExchangeRate/User Interface/View/SendMoneyExchangeRateViewController.swift +++ b/GME Remit/Modules/SendMoneyModules/SendMoneyExchangeRate/User Interface/View/SendMoneyExchangeRateViewController.swift @@ -7,6 +7,7 @@ // import UIKit +import Hero class SendMoneyExchangeRateCurrencyViewModel { var countryCode: String? @@ -171,8 +172,8 @@ class SendMoneyExchangeRateViewController: UIViewController { super.viewDidAppear(animated) if isFirst { - senderTextField.becomeFirstResponder() - isFirst = false + self.senderTextField.becomeFirstResponder() + self.isFirst = false } } @@ -192,6 +193,7 @@ class SendMoneyExchangeRateViewController: UIViewController { // MARK: Other Functions private func setup() { // all setup should be done here + setupTargets() action = .calculate senderTextField.delegate = self