From 07795a36666e9c9bdd0fbe213d2549f0c086240d Mon Sep 17 00:00:00 2001 From: gme_2 Date: Mon, 18 Feb 2019 09:11:54 +0900 Subject: [PATCH] cleaned --- GMERemittance/AppDelegate.swift | 2 +- GMERemittance/Model/Reciepient.swift | 4 +- .../View/PaymentSelectionViewController.swift | 14 +++--- .../Wireframe/PaymentSelectionWireframe.swift | 8 ++-- .../RecipientListViewController.swift | 6 +-- .../Splash/_SplashScreenViewController.swift | 43 ++----------------- 6 files changed, 20 insertions(+), 57 deletions(-) diff --git a/GMERemittance/AppDelegate.swift b/GMERemittance/AppDelegate.swift index bd9f0061..9b23ea99 100644 --- a/GMERemittance/AppDelegate.swift +++ b/GMERemittance/AppDelegate.swift @@ -20,7 +20,7 @@ import IQKeyboardManagerSwift import LGSideMenuController import Localize_Swift -let server: Server = .uat +let server: Server = .stagging @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterDelegate, MessagingDelegate { diff --git a/GMERemittance/Model/Reciepient.swift b/GMERemittance/Model/Reciepient.swift index badc9e72..128c5c6a 100644 --- a/GMERemittance/Model/Reciepient.swift +++ b/GMERemittance/Model/Reciepient.swift @@ -171,7 +171,7 @@ class RecipientListWrapperContainer: Mappable { var message: String? var id: String? var reciepients: [Recipient]? - var acunts: [Account]? + var accounts: [Account]? required init?(map: Map) { @@ -179,7 +179,7 @@ class RecipientListWrapperContainer: Mappable { func mapping(map: Map) { reciepients <- map["Receivers"] - acunts <- map["AccountList"] + accounts <- map["AccountList"] errorCode <- map["ErrorCode"] id <- map["Id"] message <- map["Msg"] diff --git a/GMERemittance/Module/PaymentSelection/User Interface/View/PaymentSelectionViewController.swift b/GMERemittance/Module/PaymentSelection/User Interface/View/PaymentSelectionViewController.swift index 8c2f5676..b79ad5f0 100644 --- a/GMERemittance/Module/PaymentSelection/User Interface/View/PaymentSelectionViewController.swift +++ b/GMERemittance/Module/PaymentSelection/User Interface/View/PaymentSelectionViewController.swift @@ -19,7 +19,7 @@ class PaymentSelectionViewController: UIViewController { @IBOutlet weak var mainView: UIView! @IBOutlet weak var closeButton: UIButton! - var acunts: [Account]? + var accounts: [Account]? var onSelection: ((Account) -> ())? @IBOutlet weak var tableView: UITableView! @@ -65,7 +65,7 @@ extension PaymentSelectionViewController: PaymentSelectionViewInterface { extension PaymentSelectionViewController: UITableViewDelegate { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { - if let cunt = self.acunts?.elementAt(index: indexPath.row) { + if let cunt = self.accounts?.elementAt(index: indexPath.row) { self.dismiss(animated: true) { self.onSelection?(cunt) } @@ -75,13 +75,13 @@ extension PaymentSelectionViewController: UITableViewDelegate { extension PaymentSelectionViewController: UITableViewDataSource { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - return self.acunts?.count ?? 0 + return self.accounts?.count ?? 0 } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - let pennis = tableView.dequeueReusableCell(withIdentifier: "PaymentSelectionTableViewCell") as! PaymentSelectionTableViewCell - pennis.cunt = acunts?.elementAt(index: indexPath.row) - pennis.setup() - return pennis + let model = tableView.dequeueReusableCell(withIdentifier: "PaymentSelectionTableViewCell") as! PaymentSelectionTableViewCell + model.cunt = accounts?.elementAt(index: indexPath.row) + model.setup() + return model } } diff --git a/GMERemittance/Module/PaymentSelection/User Interface/Wireframe/PaymentSelectionWireframe.swift b/GMERemittance/Module/PaymentSelection/User Interface/Wireframe/PaymentSelectionWireframe.swift index 2eb4dcfb..56900942 100644 --- a/GMERemittance/Module/PaymentSelection/User Interface/Wireframe/PaymentSelectionWireframe.swift +++ b/GMERemittance/Module/PaymentSelection/User Interface/Wireframe/PaymentSelectionWireframe.swift @@ -10,7 +10,7 @@ import UIKit class PaymentSelectionWireframe { weak var view: UIViewController! - var acunts: [Account]? + var accounts: [Account]? var onSeelction: ((Account) -> ())? } @@ -23,7 +23,7 @@ extension PaymentSelectionWireframe: PaymentSelectionWireframeInput { let interactor = PaymentSelectionInteractor(service: service) let presenter = PaymentSelectionPresenter() let viewController = viewControllerFromStoryboard(of: PaymentSelectionViewController.self) - viewController.acunts = self.acunts + viewController.accounts = self.accounts viewController.onSelection = self.onSeelction viewController.presenter = presenter interactor.output = presenter @@ -35,8 +35,8 @@ extension PaymentSelectionWireframe: PaymentSelectionWireframeInput { return viewController } - func openPaymentSelection(acunts: [Account], onSelection: @escaping (Account) -> (), source: UIViewController) { - self.acunts = acunts + func openPaymentSelection(accounts: [Account], onSelection: @escaping (Account) -> (), source: UIViewController) { + self.accounts = accounts self.onSeelction = onSelection self.openMainView(source: source) } diff --git a/GMERemittance/Recipient/RecipientListViewController.swift b/GMERemittance/Recipient/RecipientListViewController.swift index c20a2b7f..2a919d41 100644 --- a/GMERemittance/Recipient/RecipientListViewController.swift +++ b/GMERemittance/Recipient/RecipientListViewController.swift @@ -37,7 +37,7 @@ class RecipientListViewController: UIViewController { } } - var acunts: [Account]? + var accounts: [Account]? var selectedIndex: Int? @@ -125,7 +125,7 @@ extension RecipientListViewController: UITableViewDelegate,UITableViewDataSource private func showMethodSelection(for index: Int) { self.selectedIndex = index let wireframe = PaymentSelectionWireframe() - wireframe.openPaymentSelection(acunts: self.acunts ?? [], onSelection: self.selectedAcunt, source: self) + wireframe.openPaymentSelection(accounts: self.accounts ?? [], onSelection: self.selectedAcunt, source: self) } func selectedAcunt(acunt: Account) { @@ -201,7 +201,7 @@ extension RecipientListViewController: UITableViewDelegate,UITableViewDataSource self.fetchReciepientList(username: myUsername, success: { (reciepients) in self.hideProgressHud() // TODO - self.acunts = reciepients?.acunts + self.accounts = reciepients?.accounts self.reciepients = reciepients?.reciepients }) { (error) in self.hideProgressHud() diff --git a/GMERemittance/Splash/_SplashScreenViewController.swift b/GMERemittance/Splash/_SplashScreenViewController.swift index 822417da..8adfd965 100644 --- a/GMERemittance/Splash/_SplashScreenViewController.swift +++ b/GMERemittance/Splash/_SplashScreenViewController.swift @@ -51,49 +51,17 @@ class _SplashScreenViewController: UIViewController { } override func viewDidLoad() { super.viewDidLoad() - - - setUpButtons() - - imageViewDotLeft.image = UIImage(named: "dotSelected") let leftSwipe = UISwipeGestureRecognizer(target: self, action: #selector(_SplashScreenViewController.handleSwipes(_:))) let rightSwipe = UISwipeGestureRecognizer(target: self, action: #selector(_SplashScreenViewController.handleSwipes(_:))) - leftSwipe.direction = .left rightSwipe.direction = .right - view.addGestureRecognizer(leftSwipe) view.addGestureRecognizer(rightSwipe) - Timer.scheduledTimer(timeInterval: 2, target: self, selector: #selector(_SplashScreenViewController.updateImage), userInfo: nil, repeats: true) - } - func redirectToApp(){ - if (UserDefaults.standard.object(forKey: "com.gmeremit.loginStatus") as! Bool){ - guard (UserDefaults.standard.object(forKey: "com.gmeremit.isKYCSubmitted") as! Bool) else { - let storyboard = UIStoryboard.init(name: "Main", bundle: Bundle.main) - if let KYCPersonalInfoViewController = storyboard.instantiateViewController(withIdentifier: "KYCPersonalInfoViewController") as? KYCPersonalInfoViewController { - - self.navigationController!.pushViewController(KYCPersonalInfoViewController, animated: true) - } - return - } -// self.performSegue(withIdentifier: "autoLogin", sender: nil) - let mainWireFram = MainWireframe.shared - let window = UIApplication.shared.keyWindow - window?.rootViewController = mainWireFram?.getMainView() - window?.makeKeyAndVisible() - } else { - let storyboard = UIStoryboard.init(name: "Main", bundle: Bundle.main) - if let loginViewController = storyboard.instantiateViewController(withIdentifier: "loginViewController") as? LoginViewController { - - self.navigationController!.pushViewController(loginViewController, animated: true) - } - } - } @objc func handleSwipes(_ sender: UISwipeGestureRecognizer) { if (sender.direction == .right) { @@ -122,23 +90,18 @@ class _SplashScreenViewController: UIViewController { func setImageandLabels() { -// imageViewDotLeft.image = imageDotUnselected -// imageViewDotCenter.image = imageDotUnselected -// imageViewDotRight.image = imageDotUnselected - switch counter { case 0: -// imageViewDotLeft.image = imageDotSelected imageViewHomeLogo.image = imageFirst - labelHomeDescription.text = descriptionFirst + labelHomeDescription.text = "hassle_free_transfer_text".localized() case 1: // imageViewDotCenter.image = imageDotSelected imageViewHomeLogo.image = imageSecond - labelHomeDescription.text = descriptionSecond + labelHomeDescription.text = "connect_local_community_text".localized() case 2: // imageViewDotRight.image = imageDotSelected imageViewHomeLogo.image = imageThird - labelHomeDescription.text = descriptionThird + labelHomeDescription.text = "earn_reward_point_text".localized() default: return }