Browse Source

cleaned

pull/1/head
gme_2 6 years ago
parent
commit
07795a3666
  1. 2
      GMERemittance/AppDelegate.swift
  2. 4
      GMERemittance/Model/Reciepient.swift
  3. 14
      GMERemittance/Module/PaymentSelection/User Interface/View/PaymentSelectionViewController.swift
  4. 8
      GMERemittance/Module/PaymentSelection/User Interface/Wireframe/PaymentSelectionWireframe.swift
  5. 6
      GMERemittance/Recipient/RecipientListViewController.swift
  6. 43
      GMERemittance/Splash/_SplashScreenViewController.swift

2
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 {

4
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"]

14
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
}
}

8
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)
}

6
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()

43
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
}

Loading…
Cancel
Save