|
|
@ -1,41 +1,39 @@ |
|
|
|
// |
|
|
|
// KycViewController.swift |
|
|
|
// GMERemittance |
|
|
|
// |
|
|
|
// Created by gme_2 on 12/09/2018. |
|
|
|
//Copyright © 2018 Gobal Money Express Co. Ltd. All rights reserved. |
|
|
|
// |
|
|
|
|
|
|
|
import UIKit |
|
|
|
import XLPagerTabStrip |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protocol KYCForm1Delegate { |
|
|
|
// |
|
|
|
// KycViewController.swift |
|
|
|
// GMERemittance |
|
|
|
// |
|
|
|
// Created by gme_2 on 12/09/2018. |
|
|
|
// Copyright © 2018 Gobal Money Express Co. Ltd. All rights reserved. |
|
|
|
// |
|
|
|
|
|
|
|
import UIKit |
|
|
|
import XLPagerTabStrip |
|
|
|
|
|
|
|
protocol KYCForm1Delegate { |
|
|
|
func _continue(model: KycForm1Model) |
|
|
|
func show(model: KycModel) |
|
|
|
func addModel(model: KycForm1Model) |
|
|
|
} |
|
|
|
|
|
|
|
protocol KYCForm2Delegate { |
|
|
|
} |
|
|
|
|
|
|
|
protocol KYCForm2Delegate { |
|
|
|
func addModel(model: KycForm2Model) |
|
|
|
func _continue(model: KycForm2Model) |
|
|
|
} |
|
|
|
|
|
|
|
protocol KYCForm3Delegate { |
|
|
|
} |
|
|
|
|
|
|
|
protocol KYCForm3Delegate { |
|
|
|
func isAllCompleted(isCompletedKYC3: Bool) -> Bool |
|
|
|
func submit(model: KycForm3Model) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
class KYCRequestModel { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
class KYCRequestModel { |
|
|
|
var kycForm1: KycForm1Model? |
|
|
|
var kycForm2: KycForm2Model? |
|
|
|
var kycForm3: KycForm3Model? |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
class KycViewController: ButtonBarPagerTabStripViewController { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
class KycViewController: ButtonBarPagerTabStripViewController { |
|
|
|
|
|
|
|
enum KycViewControllers: Int { |
|
|
|
case form1 = 0 |
|
|
@ -109,12 +107,8 @@ |
|
|
|
|
|
|
|
override func viewControllers(for pagerTabStripController: PagerTabStripViewController) -> [UIViewController] { |
|
|
|
self.form1 = KycForm1Wireframe().getMainViewWithDelegate(delegate: self) |
|
|
|
let _ = form1.view |
|
|
|
self.form2 = KycForm2Wireframe().getMainViewWithDelegate(delegate: self) |
|
|
|
let _ = form2.view |
|
|
|
self.form3 = KycForm3Wireframe().getMainViewWithDelegate(delegate: self) |
|
|
|
let _ = form3.view |
|
|
|
|
|
|
|
return [form1, form2, form3] |
|
|
|
} |
|
|
|
|
|
|
@ -151,10 +145,10 @@ |
|
|
|
self.moveToViewController(at: KycViewControllers.fomr3.rawValue) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// MARK: KycViewInterface |
|
|
|
extension KycViewController: KycViewInterface { |
|
|
|
} |
|
|
|
|
|
|
|
// MARK: KycViewInterface |
|
|
|
extension KycViewController: KycViewInterface { |
|
|
|
|
|
|
|
func show(error: String) { |
|
|
|
self.alert(type: .error, message: error) |
|
|
@ -167,10 +161,10 @@ |
|
|
|
func hideLoading() { |
|
|
|
self.hideProgressHud() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
extension KycViewController: KYCForm1Delegate { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
extension KycViewController: KYCForm1Delegate { |
|
|
|
|
|
|
|
func addModel(model: KycForm1Model) { |
|
|
|
self.requestModel?.kycForm1 = model |
|
|
@ -188,9 +182,9 @@ |
|
|
|
func show(model: KycModel) { |
|
|
|
self.kycModel = model |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
extension KycViewController: KYCForm2Delegate { |
|
|
|
} |
|
|
|
|
|
|
|
extension KycViewController: KYCForm2Delegate { |
|
|
|
|
|
|
|
func addModel(model: KycForm2Model) { |
|
|
|
self.requestModel?.kycForm2 = model |
|
|
@ -200,18 +194,18 @@ |
|
|
|
self.requestModel?.kycForm2 = model |
|
|
|
moveToViewController(at: KycViewControllers.fomr3.rawValue) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
extension KycViewController: KYCForm3Delegate { |
|
|
|
} |
|
|
|
|
|
|
|
extension KycViewController: KYCForm3Delegate { |
|
|
|
func isAllCompleted(isCompletedKYC3: Bool) -> Bool { |
|
|
|
return requestModel?.kycForm1?.isCompleted ?? false && |
|
|
|
requestModel?.kycForm2?.isCompleted ?? false && |
|
|
|
isCompletedKYC3 |
|
|
|
isCompletedKYC3 |
|
|
|
} |
|
|
|
|
|
|
|
func submit(model: KycForm3Model) { |
|
|
|
self.requestModel?.kycForm3 = model |
|
|
|
self.initiateSubmitProcess() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|