|
@ -88,7 +88,7 @@ class KycForm1ViewController: UIViewController { |
|
|
|
|
|
|
|
|
var presenter: KycForm1ModuleInterface? |
|
|
var presenter: KycForm1ModuleInterface? |
|
|
var kycForm1Model: KycForm1Model = KycForm1Model() |
|
|
var kycForm1Model: KycForm1Model = KycForm1Model() |
|
|
|
|
|
|
|
|
|
|
|
var continueActionInitiated = false |
|
|
let datePicker = UIDatePicker() |
|
|
let datePicker = UIDatePicker() |
|
|
|
|
|
|
|
|
var errorTextFieldDict: [String: UITextField] = [:] |
|
|
var errorTextFieldDict: [String: UITextField] = [:] |
|
@ -140,15 +140,16 @@ class KycForm1ViewController: UIViewController { |
|
|
|
|
|
|
|
|
override func viewWillDisappear(_ animated: Bool) { |
|
|
override func viewWillDisappear(_ animated: Bool) { |
|
|
super.viewWillDisappear(animated) |
|
|
super.viewWillDisappear(animated) |
|
|
createModel() |
|
|
|
|
|
|
|
|
self.continueActionInitiated = false |
|
|
self.validate() |
|
|
self.validate() |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// MARK: IBActions |
|
|
// MARK: IBActions |
|
|
|
|
|
|
|
|
@IBAction func save(_ sender: UIButton) { |
|
|
@IBAction func save(_ sender: UIButton) { |
|
|
self.view.endEditing(true) |
|
|
self.view.endEditing(true) |
|
|
createModel() |
|
|
|
|
|
|
|
|
self.continueActionInitiated = true |
|
|
validate() |
|
|
validate() |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -207,6 +208,7 @@ class KycForm1ViewController: UIViewController { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private func validate() { |
|
|
private func validate() { |
|
|
|
|
|
self.createModel() |
|
|
self.delegate?.validate(model: self.kycForm1Model) |
|
|
self.delegate?.validate(model: self.kycForm1Model) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -288,9 +290,14 @@ extension KycForm1ViewController: KycForm1ViewInterface { |
|
|
// todo remove this from this viper flow. its now in parent |
|
|
// todo remove this from this viper flow. its now in parent |
|
|
func show(result: (doesNotSucks: Bool, errorsDick: [String : String])) { |
|
|
func show(result: (doesNotSucks: Bool, errorsDick: [String : String])) { |
|
|
var position = 11 |
|
|
var position = 11 |
|
|
|
|
|
var result = result |
|
|
|
|
|
result.doesNotSucks = true |
|
|
if result.doesNotSucks { // if isValid |
|
|
if result.doesNotSucks { // if isValid |
|
|
// its is not valid, lets go to security page |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// its is not valid, lets go to security page only if continue button was tapped |
|
|
|
|
|
if self.continueActionInitiated { |
|
|
self.delegate?._continue(model: self.kycForm1Model) |
|
|
self.delegate?._continue(model: self.kycForm1Model) |
|
|
|
|
|
} |
|
|
}else { |
|
|
}else { |
|
|
result.errorsDick.forEach({ |
|
|
result.errorsDick.forEach({ |
|
|
let label = errorLabelsDict[$0.key] |
|
|
let label = errorLabelsDict[$0.key] |
|
|