@ -44,6 +44,7 @@ class NewRegisterStep1ViewController: UIViewController {
// MARK: I B O u t l e t s
// MARK: I B O u t l e t s
@IBOutlet private weak var scrollView : UIScrollView !
@IBOutlet private weak var scrollView : UIScrollView !
@IBOutlet private weak var personalInformationLabel : UILabel !
@IBOutlet private weak var userNameTextField : ValidationTextField !
@IBOutlet private weak var userNameTextField : ValidationTextField !
@IBOutlet private weak var genderTextField : ValidationTextField !
@IBOutlet private weak var genderTextField : ValidationTextField !
@IBOutlet private weak var dobTextField : ValidationTextField !
@IBOutlet private weak var dobTextField : ValidationTextField !
@ -61,18 +62,22 @@ class NewRegisterStep1ViewController: UIViewController {
@IBOutlet private weak var bankSaveButton : UIButton !
@IBOutlet private weak var bankSaveButton : UIButton !
@IBOutlet private weak var picturesSaveButton : UIButton !
@IBOutlet private weak var picturesSaveButton : UIButton !
@IBOutlet private weak var bankInformationLabel : UILabel !
@IBOutlet private weak var bankTextField : ValidationTextField !
@IBOutlet private weak var bankTextField : ValidationTextField !
@IBOutlet private weak var bankAccountTextField : ValidationTextField !
@IBOutlet private weak var bankAccountTextField : ValidationTextField !
@IBOutlet private weak var passportInformationLabel : UILabel !
@IBOutlet private weak var passportNumberTextField : ValidationTextField !
@IBOutlet private weak var passportNumberTextField : ValidationTextField !
@IBOutlet private weak var passportIssueDateTextField : ValidationTextField !
@IBOutlet private weak var passportIssueDateTextField : ValidationTextField !
@IBOutlet private weak var passportExpiryDateTextField : ValidationTextField !
@IBOutlet private weak var passportExpiryDateTextField : ValidationTextField !
@IBOutlet private weak var anotherIDLabel : UILabel !
@IBOutlet private weak var idTypeTextField : ValidationTextField !
@IBOutlet private weak var idTypeTextField : ValidationTextField !
@IBOutlet private weak var idNumberTextField : ValidationTextField !
@IBOutlet private weak var idNumberTextField : ValidationTextField !
@IBOutlet private weak var idIssueDateTextField : ValidationTextField !
@IBOutlet private weak var idIssueDateTextField : ValidationTextField !
@IBOutlet private weak var idExpiryDateTextField : ValidationTextField !
@IBOutlet private weak var idExpiryDateTextField : ValidationTextField !
@IBOutlet private weak var additionalInformationLabel : UILabel !
@IBOutlet private weak var branchTextField : ValidationTextField !
@IBOutlet private weak var branchTextField : ValidationTextField !
@IBOutlet private weak var referralTextField : ValidationTextField !
@IBOutlet private weak var referralTextField : ValidationTextField !
@ -81,6 +86,7 @@ class NewRegisterStep1ViewController: UIViewController {
@IBOutlet private weak var passportImageButton : UIButton !
@IBOutlet private weak var passportImageButton : UIButton !
@IBOutlet private weak var anotherIDImageButton : UIButton !
@IBOutlet private weak var anotherIDImageButton : UIButton !
@IBOutlet private weak var uploadPicturesLabel : UILabel !
@IBOutlet private weak var passportSampleButton : UIButton !
@IBOutlet private weak var passportSampleButton : UIButton !
@IBOutlet private weak var anotherIDSampleButton : UIButton !
@IBOutlet private weak var anotherIDSampleButton : UIButton !
@IBOutlet private weak var anotherIDClearButton : UIButton !
@IBOutlet private weak var anotherIDClearButton : UIButton !
@ -92,6 +98,9 @@ class NewRegisterStep1ViewController: UIViewController {
@IBOutlet private weak var additionalInformationGroupImageView : UIImageView !
@IBOutlet private weak var additionalInformationGroupImageView : UIImageView !
@IBOutlet private weak var picturesInformationGroupImageView : UIImageView !
@IBOutlet private weak var picturesInformationGroupImageView : UIImageView !
@IBOutlet private weak var passportImageLabel : UILabel !
@IBOutlet private weak var anotherIDImageLabel : UILabel !
// MARK: V C ' s L i f e c y c l e
// MARK: V C ' s L i f e c y c l e
override func viewDidLoad ( ) {
override func viewDidLoad ( ) {
super . viewDidLoad ( )
super . viewDidLoad ( )
@ -208,7 +217,7 @@ extension NewRegisterStep1ViewController {
idIssueDateTextField . isHidden = true
idIssueDateTextField . isHidden = true
idExpiryDateTextField . isHidden = true
idExpiryDateTextField . isHidden = true
let genderConfigure = TablePresenterConfiguration ( presenterTitle : " Select Gender " )
let genderConfigure = TablePresenterConfiguration ( presenterTitle : " gender_placeholder_text " . localized ( ) )
genderTextField . useAsDropDown (
genderTextField . useAsDropDown (
with : genderConfigure ,
with : genderConfigure ,
@ -234,15 +243,6 @@ extension NewRegisterStep1ViewController {
idExpiryDateTextField . validCondition = { _ in true }
idExpiryDateTextField . validCondition = { _ in true }
referralTextField . validCondition = { _ in true }
referralTextField . validCondition = { _ in true }
userNameTextField . errorMessage = " kyc_first_name_error " . localized ( )
emailTextField . errorMessage = " Invalid email address " . localized ( )
addressTextField . errorMessage = " The address cannot exceed 50 characters. " . localized ( )
bankAccountTextField . errorMessage = " invalid_account_error_text " . localized ( )
passportNumberTextField . errorMessage = " Invalid possport number " . localized ( )
idNumberTextField . errorMessage = " Invalid ID number " . localized ( )
idNumberTextField . delegate = self
idNumberTextField . delegate = self
setDatePicker ( textField : dobTextField , useMaximum : true )
setDatePicker ( textField : dobTextField , useMaximum : true )
@ -251,6 +251,7 @@ extension NewRegisterStep1ViewController {
setDatePicker ( textField : idIssueDateTextField , useMaximum : true )
setDatePicker ( textField : idIssueDateTextField , useMaximum : true )
setDatePicker ( textField : idExpiryDateTextField , useMaximum : false , useMinimum : true )
setDatePicker ( textField : idExpiryDateTextField , useMaximum : false , useMinimum : true )
setMultiLanguages ( )
}
}
private func setUIBinding ( ) {
private func setUIBinding ( ) {
@ -495,22 +496,22 @@ extension NewRegisterStep1ViewController {
} ) . disposed ( by : disposeBag )
} ) . disposed ( by : disposeBag )
output . cities . drive ( onNext : { [ weak self ] in
output . cities . drive ( onNext : { [ weak self ] in
let configure = TablePresenterConfiguration ( presenterTitle : " Select City " )
let configure = TablePresenterConfiguration ( presenterTitle : " select_city_text " . localized ( ) )
self ? . cityTextField . useAsDropDown ( with : configure , items : $0 )
self ? . cityTextField . useAsDropDown ( with : configure , items : $0 )
} ) . disposed ( by : disposeBag )
} ) . disposed ( by : disposeBag )
output . banks . drive ( onNext : { [ weak self ] in
output . banks . drive ( onNext : { [ weak self ] in
let configure = TablePresenterConfiguration ( presenterTitle : " Select Bank " )
let configure = TablePresenterConfiguration ( presenterTitle : " select_bank_text " . localized ( ) )
self ? . bankTextField . useAsDropDown ( with : configure , items : $0 )
self ? . bankTextField . useAsDropDown ( with : configure , items : $0 )
} ) . disposed ( by : disposeBag )
} ) . disposed ( by : disposeBag )
output . idTypes . drive ( onNext : { [ weak self ] in
output . idTypes . drive ( onNext : { [ weak self ] in
let configure = TablePresenterConfiguration ( presenterTitle : " Select ID Type " )
let configure = TablePresenterConfiguration ( presenterTitle : " select_id_type_text " . localized ( ) )
self ? . idTypeTextField . useAsDropDown ( with : configure , items : $0 )
self ? . idTypeTextField . useAsDropDown ( with : configure , items : $0 )
} ) . disposed ( by : disposeBag )
} ) . disposed ( by : disposeBag )
output . branches . drive ( onNext : { [ weak self ] in
output . branches . drive ( onNext : { [ weak self ] in
let configure = TablePresenterConfiguration ( presenterTitle : " Select Branch " )
let configure = TablePresenterConfiguration ( presenterTitle : " select_branch_text " . localized ( ) )
self ? . branchTextField . useAsDropDown ( with : configure , items : $0 )
self ? . branchTextField . useAsDropDown ( with : configure , items : $0 )
} ) . disposed ( by : disposeBag )
} ) . disposed ( by : disposeBag )
@ -647,6 +648,69 @@ extension NewRegisterStep1ViewController {
textField . sendActions ( for : . editingChanged )
textField . sendActions ( for : . editingChanged )
} ) . disposed ( by : disposeBag )
} ) . disposed ( by : disposeBag )
}
}
private func setMultiLanguages ( ) {
personalInformationLabel . text = " personal_information_text " . localized ( )
userNameTextField . placeholder = " fullname_placeholder_text " . localized ( )
userNameTextField . errorMessage = " kyc_first_name_error " . localized ( )
genderTextField . placeholder = " gender_text " . localized ( )
dobTextField . placeholder = " dob_text " . localized ( )
emailTextField . placeholder = " email_text " . localized ( )
emailTextField . errorMessage = " email_error_text " . localized ( )
cityTextField . placeholder = " city_text " . localized ( )
addressTextField . placeholder = " address_text " . localized ( )
addressTextField . errorMessage = " address_error_text " . localized ( )
personalSaveButton . setTitle ( " save_and_continue_text " . localized ( ) , for : . normal )
bankInformationLabel . text = " korea_bank_infornation_text " . localized ( )
bankTextField . placeholder = " korea_bank_placeholder_text " . localized ( )
bankAccountTextField . placeholder = " account_text " . localized ( )
bankAccountTextField . errorMessage = " invalid_account_error_text " . localized ( )
passportInformationLabel . text = " passport_information_text " . localized ( )
passportNumberTextField . placeholder = " passport_number_text " . localized ( )
passportNumberTextField . errorMessage = " passport_error_text " . localized ( )
passportIssueDateTextField . placeholder = " passport_issue_date_text " . localized ( )
passportExpiryDateTextField . placeholder = " passport_expiry_date_text " . localized ( )
anotherIDLabel . text = " another_id_information_text " . localized ( )
idTypeTextField . placeholder = " id_type_text " . localized ( )
idNumberTextField . placeholder = " id_number_text " . localized ( )
idIssueDateTextField . placeholder = " another_id_issue_date_text " . localized ( )
idExpiryDateTextField . placeholder = " another_id_expiry_date_text " . localized ( )
idNumberTextField . errorMessage = " Invalid ID number " . localized ( )
anotherIDClearButton . setTitle ( " clear_text " . localized ( ) , for : . normal )
additionalInformationLabel . text = " additional_information_text " . localized ( )
branchTextField . placeholder = " branch_text " . localized ( )
referralTextField . placeholder = " referral_code_text " . localized ( )
bankSaveButton . setTitle ( " save_and_continue_text " . localized ( ) , for : . normal )
uploadPicturesLabel . text = " upload_pictures_text " . localized ( )
passportImageLabel . text = " passport_text " . localized ( )
anotherIDImageLabel . text = " another_id_information_text " . localized ( )
passportSampleButton . setTitle ( " view_sample_text " . localized ( ) , for : . normal )
anotherIDSampleButton . setTitle ( " view_sample_text " . localized ( ) , for : . normal )
picturesSaveButton . setTitle ( " save_and_next_text " . localized ( ) , for : . normal )
}
}
}
// MARK: C L L o c a t i o n M a n a g e r D e l e g a t e
// MARK: C L L o c a t i o n M a n a g e r D e l e g a t e
@ -663,7 +727,7 @@ extension NewRegisterStep1ViewController: CLLocationManagerDelegate {
locationManager . stopUpdatingLocation ( )
locationManager . stopUpdatingLocation ( )
let alert = UIAlertController (
let alert = UIAlertController (
title : " Settings " ,
title : " settings_text " . localized ( ) ,
message : " Allow location from settings " ,
message : " Allow location from settings " ,
preferredStyle : . alert
preferredStyle : . alert
)
)