@ -29,15 +29,15 @@ class Occupation {
}
struct KycForm1FieldKeys {
static let firstName = " firstN ame "
static let middleName = " middleN ame "
static let lastName = " lastN ame "
static let firstName = " firstn ame "
static let middleName = " middlen ame "
static let lastName = " lastn ame "
static let gender = " gender "
static let dob = " dob "
static let mobileNumber = " mobileN umber "
static let dob = " date of birth "
static let mobileNumber = " mobile n umber "
static let email = " email "
static let nativeCountry = " nativeC ountry "
static let country = " country "
static let nativeCountry = " native c ountry "
static let country = " address "
static let province = " province "
static let occupation = " occupation "
}
@ -47,6 +47,8 @@ class KycForm1ViewController: UIViewController {
struct Constants {
static let segmentBackgroundViewColor = UIColor . init ( hex : " E7EDF2 " )
static let stateRedColor = UIColor . init ( hex : " #EC1C24 " )
static let errorBorderWidth = AppConstants . errorBorderWidth
static let errorLabelFont = Fonts . Error . font
static let clearColor = UIColor . clear
static let male = " Male "
static let female = " Female "
@ -141,6 +143,12 @@ class KycForm1ViewController: UIViewController {
}
override func viewWillAppear ( _ animated : Bool ) {
super . viewWillAppear ( animated )
self . view . endEditing ( true )
removeFocus ( )
}
override func viewWillDisappear ( _ animated : Bool ) {
super . viewWillDisappear ( animated )
self . view . endEditing ( true )
@ -161,6 +169,12 @@ class KycForm1ViewController: UIViewController {
// MARK: O t h e r F u n c t i o n s
private func removeFocus ( ) {
self . textfields . forEach ( {
$0 . resignFirstResponder ( )
} )
}
private func createModel ( ) {
self . kycForm1Model . firstName = self . firstNameTextField . text !
self . kycForm1Model . middleName = self . middleNmaeTextField . text !
@ -222,7 +236,11 @@ class KycForm1ViewController: UIViewController {
}
private func setupErrorLabels ( ) {
self . errorLabels = [ firstNameErrorLabel , middleNameErrorLabel , lastNameErrorLabel , genderErrorLabel , dobErrorLabel , mobileNumberErrorLabel , emailErrorLabel , nativeCountryErrorLabel , nativeCountryErrorLabel , provinceErrorLabel , occupationErrorLabel ]
self . errorLabels = [ firstNameErrorLabel , middleNameErrorLabel , lastNameErrorLabel , genderErrorLabel , dobErrorLabel , mobileNumberErrorLabel , emailErrorLabel , nativeCountryErrorLabel , nativeCountryErrorLabel , provinceErrorLabel , occupationErrorLabel , countryErrorLabel ]
self . errorLabels . forEach ( {
$0 . font = Constants . errorLabelFont
} )
self . errorLabelsDict =
[
@ -275,7 +293,7 @@ class KycForm1ViewController: UIViewController {
private func showBorder ( textfield : UITextField ? ) {
guard let textfield = textfield else { return }
textfield . layer . borderColor = Constants . stateRedColor . cgColor
textfield . layer . borderWidth = 0.3
textfield . layer . borderWidth = Constants . errorBorderWidth
textfield . layer . addShadow ( with : Constants . stateRedColor )
}