diff --git a/GMERemittance/Library/CountryWithFlagPicker/CountryPickerViewController.swift b/GMERemittance/Library/CountryWithFlagPicker/CountryPickerViewController.swift index 4f183fe8..6ecb8c2b 100644 --- a/GMERemittance/Library/CountryWithFlagPicker/CountryPickerViewController.swift +++ b/GMERemittance/Library/CountryWithFlagPicker/CountryPickerViewController.swift @@ -18,6 +18,7 @@ enum PickerTitle: String { case branch = "Branch" case currency = "Currency" case occupation = "Occupation" + case verificationIdTypes = "Idi Type" } class CountryPickerViewController: UIViewController { diff --git a/GMERemittance/Module/New Group/kycForm1/User Interface/View/kycForm1ViewController.swift b/GMERemittance/Module/New Group/kycForm1/User Interface/View/kycForm1ViewController.swift index 99f684da..b9b3095f 100644 --- a/GMERemittance/Module/New Group/kycForm1/User Interface/View/kycForm1ViewController.swift +++ b/GMERemittance/Module/New Group/kycForm1/User Interface/View/kycForm1ViewController.swift @@ -140,6 +140,7 @@ class KycForm1ViewController: UIViewController { override func viewWillDisappear(_ animated: Bool) { super.viewWillDisappear(animated) + self.view.endEditing(true) self.continueActionInitiated = false self.validate() } diff --git a/GMERemittance/Module/New Group/kycForm2/User Interface/View/kycForm2ViewController.swift b/GMERemittance/Module/New Group/kycForm2/User Interface/View/kycForm2ViewController.swift index f8e4bc1e..5e2d6ac7 100644 --- a/GMERemittance/Module/New Group/kycForm2/User Interface/View/kycForm2ViewController.swift +++ b/GMERemittance/Module/New Group/kycForm2/User Interface/View/kycForm2ViewController.swift @@ -73,17 +73,27 @@ class KycForm2ViewController: UIViewController { var kycModel: KycModel? { didSet { self.banks = kycModel?.bank + self.verificationIdTypes = kycModel?.idType } } var banks: [KeyValueModel]? + var verificationIdTypes: [KeyValueModel]? + var selectedBank: KeyValueModel? { didSet { self.bankTextField.text = selectedBank?.text } } + var slectedVerificationIdType: KeyValueModel? { + didSet { + self.verificationIdTextField.text = self.slectedVerificationIdType?.text + } + } + + var delegate: KYCForm2Delegate? var presenter: KycForm2ModuleInterface? @@ -297,6 +307,7 @@ extension KycForm2ViewController: UITextFieldDelegate { self.bankTextField.layer.borderWidth = 0 return false case verificationIdTextField: + showVerificationIdTypePicker() // show list of verificationId type return false case sourceOfFundTextField: @@ -345,5 +356,20 @@ extension KycForm2ViewController { let _bank = self.banks?.filter({($0.text ?? "") == (banks.first ?? "") }).first self.selectedBank = _bank } + + private func showVerificationIdTypePicker() { + let viewcontroller = self.getPickerViewController() + let models = self.verificationIdTypes ?? [] + let names = models.compactMap({$0.text}) + viewcontroller.data = names + viewcontroller.type = PickerTitle.verificationIdTypes + viewcontroller.doneAction = self.cardTypeSelected + self.present(viewcontroller, animated: true, completion: nil) + } + + func cardTypeSelected(models: [String]) { + let _model = self.verificationIdTypes?.filter({($0.text ?? "") == (models.first ?? "") }).first + self.slectedVerificationIdType = _model + } }