|
@ -44,10 +44,19 @@ class CDDIViewControllerViewController: UIViewController { |
|
|
// MARK: IBActions |
|
|
// MARK: IBActions |
|
|
@IBAction func continueButton(_ sender: UIButton) { |
|
|
@IBAction func continueButton(_ sender: UIButton) { |
|
|
view.endEditing(true) |
|
|
view.endEditing(true) |
|
|
|
|
|
if self.sourceOfFund.text == "Others (please specify)" { |
|
|
|
|
|
self.alert(message: "Please Enter Others Source of Fund") |
|
|
|
|
|
} |
|
|
|
|
|
if self.purposeOfRemit.text == "Other (please specify)" { |
|
|
|
|
|
self.alert(message: "Please Enter Others Purpose of Remit") |
|
|
|
|
|
} |
|
|
|
|
|
else if self.sourceOfFund.text != "Others (please specify)" && self.purposeOfRemit.text != "Other (please specify)" { |
|
|
let model = CDDIRequestData(sourceOfFund: fund, purposeOfRemittance: purpose) |
|
|
let model = CDDIRequestData(sourceOfFund: fund, purposeOfRemittance: purpose) |
|
|
actionDelegate?.continueToVerificationAction(model: model) |
|
|
actionDelegate?.continueToVerificationAction(model: model) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// MARK: Other Functions |
|
|
// MARK: Other Functions |
|
|
|
|
|
|
|
|
private func setup() { |
|
|
private func setup() { |
|
@ -76,11 +85,41 @@ class CDDIViewControllerViewController: UIViewController { |
|
|
let alert = UIAlertController(title: "specifySourceOfFund_text".localized(), message: "", preferredStyle: .alert) |
|
|
let alert = UIAlertController(title: "specifySourceOfFund_text".localized(), message: "", preferredStyle: .alert) |
|
|
alert.addTextField(configurationHandler: nil) |
|
|
alert.addTextField(configurationHandler: nil) |
|
|
alert.addAction(UIAlertAction(title: "Submit", style: .default, handler: { [weak alert] (_) in |
|
|
alert.addAction(UIAlertAction(title: "Submit", style: .default, handler: { [weak alert] (_) in |
|
|
guard let textField = alert?.textFields?.first else { return } |
|
|
|
|
|
let setSourceOfFund = KeyValue(id: textField.text ?? "", value: textField.text ?? "") |
|
|
|
|
|
|
|
|
let textField = alert?.textFields?.first |
|
|
|
|
|
//else { return } |
|
|
|
|
|
if textField?.text == "" || textField?.text?.isEmpty ?? true { |
|
|
|
|
|
self.alert(message: "Please Enter Others Source of Fund") |
|
|
|
|
|
} else { |
|
|
|
|
|
let setSourceOfFund = KeyValue(id: textField?.text ?? "", value: textField?.text ?? "") |
|
|
|
|
|
self.sourceOfFund.didSelect( |
|
|
|
|
|
item: setSourceOfFund |
|
|
|
|
|
) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
})) |
|
|
|
|
|
self.present(alert, animated: true, completion: nil) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
return $0 as? KeyValue |
|
|
|
|
|
|
|
|
|
|
|
}.asDriverOnErrorJustComplete(), |
|
|
|
|
|
purpose: purposeOfRemit.selectedItem.map { |
|
|
|
|
|
if $0?.cellTitle == "Other (please specify)" { |
|
|
|
|
|
DispatchQueue.main.async { |
|
|
|
|
|
let alert = UIAlertController(title: "specifySourceOfFund_text".localized(), message: "", preferredStyle: .alert) |
|
|
|
|
|
alert.addTextField(configurationHandler: nil) |
|
|
|
|
|
alert.addAction(UIAlertAction(title: "Submit", style: .default, handler: { [weak alert] (_) in |
|
|
|
|
|
let textField = alert?.textFields?.first |
|
|
|
|
|
//else { return } |
|
|
|
|
|
if textField?.text == "" || textField?.text?.isEmpty ?? true { |
|
|
|
|
|
self.alert(message: "Please Enter Others Source of Fund") |
|
|
|
|
|
} else { |
|
|
|
|
|
let setSourceOfFund = KeyValue(id: textField?.text ?? "", value: textField?.text ?? "") |
|
|
self.sourceOfFund.didSelect( |
|
|
self.sourceOfFund.didSelect( |
|
|
item: setSourceOfFund |
|
|
item: setSourceOfFund |
|
|
) |
|
|
) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
})) |
|
|
})) |
|
|
self.present(alert, animated: true, completion: nil) |
|
|
self.present(alert, animated: true, completion: nil) |
|
|
} |
|
|
} |
|
@ -88,7 +127,6 @@ class CDDIViewControllerViewController: UIViewController { |
|
|
return $0 as? KeyValue |
|
|
return $0 as? KeyValue |
|
|
|
|
|
|
|
|
}.asDriverOnErrorJustComplete(), |
|
|
}.asDriverOnErrorJustComplete(), |
|
|
purpose: purposeOfRemit.selectedItem.map{$0 as? KeyValue}.asDriverOnErrorJustComplete(), |
|
|
|
|
|
submit: continueButton.rx.tap.asDriverOnErrorJustComplete() |
|
|
submit: continueButton.rx.tap.asDriverOnErrorJustComplete() |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|