Browse Source

new registration

pull/1/head
InKwon James Kim 5 years ago
parent
commit
8e77122497
  1. 4
      GME Remit.xcodeproj/project.pbxproj
  2. 1286
      GMERemittance/Model/NativeCountry.swift
  3. 58
      GMERemittance/Model/RegisterRequestModel.swift
  4. 2
      GMERemittance/Module/Home/User Interface/View/HomeViewController.swift
  5. 2
      GMERemittance/Module/LauncherScreen/User Interface/Wireframe/LauncherScreenWireframe.swift
  6. 2
      GMERemittance/Module/Login/User Interface/View/LoginViewController.swift
  7. 66
      GMERemittance/Module/RegisterModules/KYC/Kyc/Application Logic/Interactor/KycInteractor.swift
  8. 2
      GMERemittance/Module/RegisterModules/KYC/Kyc/Application Logic/Interactor/KycInteractorIO.swift
  9. 3
      GMERemittance/Module/RegisterModules/KYC/Kyc/Module Interface/KycModuleInterface.swift
  10. 50
      GMERemittance/Module/RegisterModules/KYC/Kyc/User Interface/Presenter/KycPresenter.swift
  11. 10
      GMERemittance/Module/RegisterModules/KYC/Kyc/User Interface/View/KycViewController.swift
  12. 1
      GMERemittance/Module/RegisterModules/KYC/Kyc/User Interface/View/KycViewInterface.swift
  13. 12
      GMERemittance/Module/RegisterModules/KYC/Kyc/User Interface/Wireframe/KycWireframe.swift
  14. 1
      GMERemittance/Module/RegisterModules/KYC/Kyc/User Interface/Wireframe/KycWireframeInput.swift
  15. 209
      GMERemittance/Module/RegisterModules/KYC/kycForm1/User Interface/View/kycForm1.storyboard
  16. 70
      GMERemittance/Module/RegisterModules/KYC/kycForm1/User Interface/View/kycForm1ViewController.swift
  17. 16
      GMERemittance/Module/RegisterModules/PennyTest/User Interface/View/PennyTestViewController.swift
  18. 26
      GMERemittance/Module/RegisterModules/PennyTestSubmit/User Interface/View/PennyTestSubmitViewController.swift
  19. 83
      GMERemittance/Module/RegisterModules/Register/Application Logic/Interactor/RegisterInteractor.swift
  20. 359
      GMERemittance/Module/RegisterModules/Register/User Interface/View/Register.storyboard
  21. 533
      GMERemittance/Module/RegisterModules/Register/User Interface/View/RegisterViewController.swift
  22. 2
      GMERemittance/Module/SendMoneyModules/SendMoneyVerification/User Interface/View/SendMoneyVerificationViewController.swift
  23. 2
      GMERemittance/Utility/Database/GMEDB.swift
  24. 9
      GMERemittance/Utility/SecureKeypad.swift
  25. 16
      GMERemittance/Utility/TablePresenter/User Interface/View/Cell/TableCell.swift
  26. 7
      GMERemittance/Utility/TablePresenter/User Interface/View/TablePresenterViewController.swift
  27. 2
      Pods/ValidationTextField/ValidationTextField/Classes/ValidationTextField.swift
  28. 5
      en.lproj/Localizable.strings

4
GME Remit.xcodeproj/project.pbxproj

@ -209,6 +209,7 @@
73469FA12293C1B00062946B /* PaymentCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73469F952293C1AF0062946B /* PaymentCell.swift */; };
73469FA22293C1B00062946B /* SelectPaymentViewInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73469F962293C1AF0062946B /* SelectPaymentViewInterface.swift */; };
73469FA32293C1B00062946B /* SelectPayment.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 73469F972293C1AF0062946B /* SelectPayment.storyboard */; };
7347367122EACCBA00D0219D /* NativeCountry.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7347367022EACCBA00D0219D /* NativeCountry.swift */; };
736A8C402277EB2A00337A50 /* BiometricAuthenticationNotificationModuleInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = 736A8C2D2277EB2900337A50 /* BiometricAuthenticationNotificationModuleInterface.swift */; };
736A8C412277EB2A00337A50 /* BiometricAuthenticationNotificationService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 736A8C312277EB2900337A50 /* BiometricAuthenticationNotificationService.swift */; };
736A8C422277EB2A00337A50 /* BiometricAuthenticationNotificationServiceType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 736A8C322277EB2900337A50 /* BiometricAuthenticationNotificationServiceType.swift */; };
@ -2406,6 +2407,7 @@
73469F952293C1AF0062946B /* PaymentCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PaymentCell.swift; sourceTree = "<group>"; };
73469F962293C1AF0062946B /* SelectPaymentViewInterface.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SelectPaymentViewInterface.swift; sourceTree = "<group>"; };
73469F972293C1AF0062946B /* SelectPayment.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = SelectPayment.storyboard; sourceTree = "<group>"; };
7347367022EACCBA00D0219D /* NativeCountry.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = NativeCountry.swift; path = GMERemittance/Model/NativeCountry.swift; sourceTree = SOURCE_ROOT; };
736A8C2D2277EB2900337A50 /* BiometricAuthenticationNotificationModuleInterface.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BiometricAuthenticationNotificationModuleInterface.swift; sourceTree = "<group>"; };
736A8C312277EB2900337A50 /* BiometricAuthenticationNotificationService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BiometricAuthenticationNotificationService.swift; sourceTree = "<group>"; };
736A8C322277EB2900337A50 /* BiometricAuthenticationNotificationServiceType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BiometricAuthenticationNotificationServiceType.swift; sourceTree = "<group>"; };
@ -10589,6 +10591,7 @@
D962231C212C123600B7A115 /* Model */ = {
isa = PBXGroup;
children = (
7347367022EACCBA00D0219D /* NativeCountry.swift */,
D962231D212C126500B7A115 /* ExchangeModel.swift */,
D9E57944212E938D00D47AC0 /* ExchangeRateDetailModel.swift */,
D95B5E4821314D31000C0B33 /* GmeContacts.swift */,
@ -13955,6 +13958,7 @@
D95B5E3921311057000C0B33 /* GmeContactsModuleInterface.swift in Sources */,
7313872322E68F4C0095ACEB /* ScrollableSegmentedControl.swift in Sources */,
D9CB4977213290B200B7A124 /* SendMoneyTransFerReasonViewModel.swift in Sources */,
7347367122EACCBA00D0219D /* NativeCountry.swift in Sources */,
D922D98921351AAE00D43053 /* SendMoneyExchangeRatePresenter.swift in Sources */,
736A8C472277EB2A00337A50 /* BiometricAuthenticationNotificationWireframe.swift in Sources */,
730D7891227A94E1007E517E /* RewardWireframe.swift in Sources */,

1286
GMERemittance/Model/NativeCountry.swift
File diff suppressed because it is too large
View File

58
GMERemittance/Model/RegisterRequestModel.swift

@ -17,35 +17,35 @@ import Foundation
class RegisterRequestModel: Serializer {
var username: String?
var password: String?
var encryptedPassword: String?
var encryptedConfirmPassword: String?
var confirmPassword: String?
var clientId: String?
var uuid: String?
var appVersion: String?
var phoneBrand: String?
var phoneOs: String?
var fcmId: String? // device id
var osVersion: String?
var dob: String?
func serialize() -> [String : String] {
var dict = ["":""]
dict["username"] = self.username ?? ""
dict["password"] = self.encryptedPassword ?? ""
dict["confirmPassword"] = self.encryptedConfirmPassword ?? ""
dict["clientId"] = self.clientId ?? ""
dict["uuid"] = self.uuid ?? ""
dict["appVersion"] = self.appVersion ?? ""
dict["phoneBrand"] = self.phoneBrand ?? ""
dict["phoneOs"] = self.phoneOs ?? ""
dict["fcmId"] = self.fcmId ?? ""
dict["osVersion"] = self.osVersion ?? ""
dict["Dob"] = self.dob ?? ""
return dict
}
var username: String?
var nativeCountry: String?
var mobileNumber: String?
var encryptedPassword: String?
var clientId: String?
var uuid: String?
var appVersion: String?
var phoneBrand: String?
var phoneOs: String?
var fcmId: String? // device id
var osVersion: String?
var dob: String?
func serialize() -> [String : String] {
var dict = ["":""]
dict["username"] = self.username ?? ""
dict["password"] = self.encryptedPassword ?? ""
dict["nativeCountry"] = self.nativeCountry ?? ""
dict["mobileNumber"] = self.mobileNumber ?? ""
dict["clientId"] = self.clientId ?? ""
dict["uuid"] = self.uuid ?? ""
dict["appVersion"] = self.appVersion ?? ""
dict["phoneBrand"] = self.phoneBrand ?? ""
dict["phoneOs"] = self.phoneOs ?? ""
dict["fcmId"] = self.fcmId ?? ""
dict["osVersion"] = self.osVersion ?? ""
dict["Dob"] = self.dob ?? ""
return dict
}
}

2
GMERemittance/Module/Home/User Interface/View/HomeViewController.swift

@ -692,7 +692,7 @@ extension HomeViewController: UIGestureRecognizerDelegate {
extension HomeViewController {
func save(user: User?) {
// FIXME: FOR TEST
// Utility.save(user: user)
Utility.save(user: user)
}
private func checkKFTCToken() {

2
GMERemittance/Module/LauncherScreen/User Interface/Wireframe/LauncherScreenWireframe.swift

@ -96,7 +96,7 @@ extension LauncherScreenWireframe: BiometricAuthenticationViewControllerDelegate
// MARK: - SecureKeypadDelegate
extension LauncherScreenWireframe: SecureKeypadDelegate {
func didComplete(_ encryptedString: String) {
func didComplete(_ encryptedString: String, length: Int) {
if encryptedString != "" {
KeyChain.shared.save(data: encryptedString, key: .password)
doLogin()

2
GMERemittance/Module/Login/User Interface/View/LoginViewController.swift

@ -325,7 +325,7 @@ extension LoginViewController: BiometricAuthenticationViewControllerDelegate {
// MARK: - SecureKeypadDelegate
extension LoginViewController: SecureKeypadDelegate {
func didComplete(_ encryptedString: String) {
func didComplete(_ encryptedString: String, length: Int) {
if encryptedString != "" {
self.encryptedPassword = encryptedString
self.passwordTextField.text = "password"

66
GMERemittance/Module/RegisterModules/KYC/Kyc/Application Logic/Interactor/KycInteractor.swift

@ -122,53 +122,37 @@ class KycInteractor {
// MARK: Kyc interactor input interface
extension KycInteractor: KycInteractorInput {
func validate(model: KYCRequestModel) {
let shouldSubmit = model.kycForm1?.isCompleted ?? false &&
model.kycForm2?.isCompleted ?? false &&
model.kycForm3?.isCompleted ?? false
if shouldSubmit {
/// call api here.
let params = self.getParams(model: model)
let images = self.getImageParams(model: model)
self.service.submit(param: params, images: images, success: { (response) in
func submit(model: KYCRequestModel) {
let params = self.getParams(model: model)
let images = self.getImageParams(model: model)
self.service.submit(param: params, images: images, success: { (response) in
GMEDB.shared.getFcmToken { (token, error) in
GMEDB.shared.getFcmToken { (token, error) in
guard let error = error else {
let userId = Utility.getMyUserName()
var param = ["userId" : userId]
guard let error = error else {
let userId = Utility.getMyUserName()
var param = ["userId" : userId]
param["uuid"] = Utility.getUUid() ?? ""
param["appVersion"] = Utility.getAppVersion()
param["phoneBrand"] = Utility.getPhoneBrand()
param["phoneOs"] = Utility.getPhoneOs()
param["fcmId"] = token ?? ""
param["osVersion"] = Utility.getOsVersion()
param["uuid"] = Utility.getUUid() ?? ""
param["appVersion"] = Utility.getAppVersion()
param["phoneBrand"] = Utility.getPhoneBrand()
param["phoneOs"] = Utility.getPhoneOs()
param["fcmId"] = token ?? ""
param["osVersion"] = Utility.getOsVersion()
self.service.fetchUserInfo(param: param, success: { (user) in
Utility.save(user: user)
GMEDB.shared.user.set(true, .kyc)
self.output?.submitSuccess()
}, failure: { (error) in
self.service.fetchUserInfo(param: param, success: { (user) in
Utility.save(user: user)
GMEDB.shared.user.set(true, .kyc)
self.output?.submitSuccess()
}, failure: { (error) in
})
return
}
self.output?.show(error: error)
})
return
}
}) { (error) in
self.output?.show(error: error)
}
}else {
// FIXME: FOR TEST
GMEDB.shared.user.set(true, .kyc)
self.output?.submitSuccess()
// self.output?.show(result1: result1)
// self.output?.show(result2: result2)
// self.output?.show(result3: result3)
}) { (error) in
self.output?.show(error: error)
}
}
}

2
GMERemittance/Module/RegisterModules/KYC/Kyc/Application Logic/Interactor/KycInteractorIO.swift

@ -7,7 +7,7 @@
//
protocol KycInteractorInput: class {
func validate(model: KYCRequestModel)
func submit(model: KYCRequestModel)
}
protocol KycInteractorOutput: class {

3
GMERemittance/Module/RegisterModules/KYC/Kyc/Module Interface/KycModuleInterface.swift

@ -7,6 +7,5 @@
//
protocol KycModuleInterface: class {
func validate(model: KYCRequestModel)
func goHome()
func submit(model: KYCRequestModel)
}

50
GMERemittance/Module/RegisterModules/KYC/Kyc/User Interface/Presenter/KycPresenter.swift

@ -9,41 +9,37 @@
import Foundation
class KycPresenter {
// MARK: Properties
weak var view: KycViewInterface?
var interactor: KycInteractorInput?
var wireframe: KycWireframeInput?
// MARK: Converting entities
// MARK: Properties
weak var view: KycViewInterface?
var interactor: KycInteractorInput?
var wireframe: KycWireframeInput?
// MARK: Converting entities
}
// MARK: Kyc module interface
// MARK: Kyc module interface
extension KycPresenter: KycModuleInterface {
func validate(model: KYCRequestModel) {
self.view?.showLoading()
self.interactor?.validate(model: model)
}
func submit(model: KYCRequestModel) {
self.view?.showLoading()
self.interactor?.submit(model: model)
}
}
// MARK: Kyc interactor output interface
extension KycPresenter: KycInteractorOutput {
func submitSuccess() {
wireframe?.goToPennyTest()
}
func goHome() {
self.wireframe?.gotToHome()
}
func show(error: Error) {
self.view?.hideLoading()
self.view?.show(error: error.localizedDescription)
}
func submitSuccess() {
wireframe?.goToPennyTest()
}
func show(error: Error) {
self.view?.hideLoading()
self.view?.show(error: error.localizedDescription)
}
}

10
GMERemittance/Module/RegisterModules/KYC/Kyc/User Interface/View/KycViewController.swift

@ -134,7 +134,7 @@
// TODO:
// first validate.
guard let requestModel = self.requestModel else {return}
self.presenter?.validate(model: requestModel)
self.presenter?.submit(model: requestModel)
// if error show them to respect page (if possible)
// then submit to server.
// then show result.
@ -155,14 +155,6 @@
// MARK: KycViewInterface
extension KycViewController: KycViewInterface {
func showOption() {
let message = "Would you like to apply for penny test now?"
self.alertWithOkCancel(message: message, title: "Info", okTitle: "Ok", style: UIAlertController.Style.alert, cancelTitle: "Cancel", OkStyle: UIAlertAction.Style.default, cancelStyle: UIAlertAction.Style.default, okAction: {
}) {
self.presenter?.goHome()
}
}
func show(error: String) {
self.alert(type: .error, message: error)
}

1
GMERemittance/Module/RegisterModules/KYC/Kyc/User Interface/View/KycViewInterface.swift

@ -8,7 +8,6 @@
protocol KycViewInterface: class {
func show(error: String)
func showOption()
func showLoading()
func hideLoading()
}

12
GMERemittance/Module/RegisterModules/KYC/Kyc/User Interface/Wireframe/KycWireframe.swift

@ -33,18 +33,6 @@ extension KycWireframe: KycWireframeInput {
return viewController
}
func gotToHome() {
if let navigation = self.view.navigationController {
CATransaction.begin()
CATransaction.setCompletionBlock {
NotificationCenter.default.post(name: NSNotification.Name.init("showPennyTestFirstTime"), object: nil)
}
navigation.popViewController(animated: true)
CATransaction.commit()
}
}
func goToPennyTest(){
view.navigationController?.pushViewController(PennyTestWireframe().getMainView(), animated: true)
}

1
GMERemittance/Module/RegisterModules/KYC/Kyc/User Interface/Wireframe/KycWireframeInput.swift

@ -9,6 +9,5 @@
import Foundation
protocol KycWireframeInput: WireframeInput {
func gotToHome()
func goToPennyTest()
}

209
GMERemittance/Module/RegisterModules/KYC/kycForm1/User Interface/View/kycForm1.storyboard

@ -27,10 +27,10 @@
<rect key="frame" x="0.0" y="0.0" width="375" height="1000"/>
<subviews>
<view contentMode="scaleToFill" placeholderIntrinsicWidth="375" placeholderIntrinsicHeight="1037" translatesAutoresizingMaskIntoConstraints="NO" id="1c8-A3-arc">
<rect key="frame" x="0.0" y="0.0" width="375" height="770"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="644"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" alignment="center" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="dI0-Yl-Sp1">
<rect key="frame" x="0.0" y="0.0" width="375" height="750"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="624"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Tell us a few things about yourself" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="5gp-EN-amE">
<rect key="frame" x="0.0" y="0.0" width="375" height="50"/>
@ -42,123 +42,94 @@
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Ulz-yj-JUf">
<rect key="frame" x="30" y="70" width="315" height="610"/>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="QtF-v5-ULz">
<rect key="frame" x="30" y="70" width="315" height="484"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="30" translatesAutoresizingMaskIntoConstraints="NO" id="5Yj-58-A1e">
<rect key="frame" x="0.0" y="0.0" width="315" height="610"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="QtF-v5-ULz">
<rect key="frame" x="0.0" y="0.0" width="315" height="610"/>
<subviews>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Enter your Full Name" textAlignment="natural" minimumFontSize="17" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="wBc-TT-A5d" customClass="ValidationTextField" customModule="ValidationTextField">
<rect key="frame" x="0.0" y="0.0" width="315" height="43"/>
<color key="tintColor" red="0.78177064659999995" green="0.55228364470000002" blue="0.018981300289999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="43" id="Psk-Sn-kig"/>
</constraints>
<nil key="textColor"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="14"/>
<textInputTraits key="textInputTraits" autocapitalizationType="sentences" keyboardType="alphabet" returnKeyType="next"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="string" keyPath="titleText" value="Full Name"/>
<userDefinedRuntimeAttribute type="boolean" keyPath="isShowTitle" value="NO"/>
</userDefinedRuntimeAttributes>
</textField>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Enter your Mobile No." textAlignment="natural" minimumFontSize="17" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="e0l-hm-b9a" customClass="ValidationTextField" customModule="ValidationTextField">
<rect key="frame" x="0.0" y="63" width="315" height="43"/>
<color key="tintColor" red="0.78177064659999995" green="0.55228364470000002" blue="0.018981300289999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="textColor"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="14"/>
<textInputTraits key="textInputTraits" keyboardType="numberPad"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="isShowTitle" value="NO"/>
</userDefinedRuntimeAttributes>
</textField>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Enter your Email Address" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="P4e-l6-JXm" customClass="ValidationTextField" customModule="ValidationTextField">
<rect key="frame" x="0.0" y="126" width="315" height="43"/>
<color key="tintColor" red="0.78177064659999995" green="0.55228364470000002" blue="0.018981300289999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="textColor"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="14"/>
<textInputTraits key="textInputTraits" keyboardType="emailAddress"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="isShowTitle" value="NO"/>
</userDefinedRuntimeAttributes>
</textField>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Select your Gender" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="jMe-PA-j1d" customClass="ValidationTextField" customModule="ValidationTextField">
<rect key="frame" x="0.0" y="189" width="315" height="43"/>
<nil key="textColor"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="isShowTitle" value="NO"/>
</userDefinedRuntimeAttributes>
</textField>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Select your Date of Birth" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="hEk-Wb-CTe" customClass="ValidationTextField" customModule="ValidationTextField">
<rect key="frame" x="0.0" y="252" width="315" height="43"/>
<nil key="textColor"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="isShowTitle" value="NO"/>
</userDefinedRuntimeAttributes>
</textField>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Enter your Native Country" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="cXS-dQ-HBb" customClass="ValidationTextField" customModule="ValidationTextField">
<rect key="frame" x="0.0" y="315" width="315" height="43"/>
<nil key="textColor"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="isShowTitle" value="NO"/>
</userDefinedRuntimeAttributes>
</textField>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Your Address In Korea" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="bRp-8B-RFU" customClass="ValidationTextField" customModule="ValidationTextField">
<rect key="frame" x="0.0" y="378" width="315" height="43"/>
<color key="tintColor" red="0.78177064659999995" green="0.55228364470000002" blue="0.018981300289999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="textColor"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="14"/>
<textInputTraits key="textInputTraits" keyboardType="alphabet" returnKeyType="next"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="isShowTitle" value="NO"/>
</userDefinedRuntimeAttributes>
</textField>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Enter your City" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="SC9-rY-28Z" customClass="ValidationTextField" customModule="ValidationTextField">
<rect key="frame" x="0.0" y="441" width="315" height="43"/>
<nil key="textColor"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="isShowTitle" value="NO"/>
</userDefinedRuntimeAttributes>
</textField>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Select your Occupation" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="ayn-DP-9bq" customClass="ValidationTextField" customModule="ValidationTextField">
<rect key="frame" x="0.0" y="504" width="315" height="43"/>
<nil key="textColor"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="isShowTitle" value="NO"/>
</userDefinedRuntimeAttributes>
</textField>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="If you have a referralCode" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="srZ-o3-hZr" customClass="ValidationTextField" customModule="ValidationTextField">
<rect key="frame" x="0.0" y="567" width="315" height="43"/>
<color key="tintColor" red="0.78177064659999995" green="0.55228364470000002" blue="0.018981300289999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="textColor"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="14"/>
<textInputTraits key="textInputTraits" autocorrectionType="no" keyboardType="alphabet" returnKeyType="done"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="isShowTitle" value="NO"/>
</userDefinedRuntimeAttributes>
</textField>
</subviews>
<color key="backgroundColor" red="0.90588235289999997" green="0.92941176469999998" blue="0.94901960780000005" alpha="1" colorSpace="calibratedRGB"/>
</stackView>
</subviews>
</stackView>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Enter your Full Name" textAlignment="natural" minimumFontSize="17" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="wBc-TT-A5d" customClass="ValidationTextField" customModule="ValidationTextField">
<rect key="frame" x="0.0" y="0.0" width="315" height="43"/>
<color key="tintColor" red="0.78177064659999995" green="0.55228364470000002" blue="0.018981300289999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="43" id="Psk-Sn-kig"/>
</constraints>
<nil key="textColor"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="14"/>
<textInputTraits key="textInputTraits" autocapitalizationType="sentences" keyboardType="alphabet" returnKeyType="next"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="string" keyPath="titleText" value="Full Name"/>
<userDefinedRuntimeAttribute type="boolean" keyPath="isShowTitle" value="NO"/>
</userDefinedRuntimeAttributes>
</textField>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Enter your Email Address" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="P4e-l6-JXm" customClass="ValidationTextField" customModule="ValidationTextField">
<rect key="frame" x="0.0" y="63" width="315" height="43"/>
<color key="tintColor" red="0.78177064659999995" green="0.55228364470000002" blue="0.018981300289999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="textColor"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="14"/>
<textInputTraits key="textInputTraits" keyboardType="emailAddress"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="isShowTitle" value="NO"/>
</userDefinedRuntimeAttributes>
</textField>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Select your Gender" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="jMe-PA-j1d" customClass="ValidationTextField" customModule="ValidationTextField">
<rect key="frame" x="0.0" y="126" width="315" height="43"/>
<nil key="textColor"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="isShowTitle" value="NO"/>
</userDefinedRuntimeAttributes>
</textField>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Select your Date of Birth" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="hEk-Wb-CTe" customClass="ValidationTextField" customModule="ValidationTextField">
<rect key="frame" x="0.0" y="189" width="315" height="43"/>
<nil key="textColor"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="isShowTitle" value="NO"/>
</userDefinedRuntimeAttributes>
</textField>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Your Address In Korea" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="bRp-8B-RFU" customClass="ValidationTextField" customModule="ValidationTextField">
<rect key="frame" x="0.0" y="252" width="315" height="43"/>
<color key="tintColor" red="0.78177064659999995" green="0.55228364470000002" blue="0.018981300289999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="textColor"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="14"/>
<textInputTraits key="textInputTraits" keyboardType="alphabet" returnKeyType="next"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="isShowTitle" value="NO"/>
</userDefinedRuntimeAttributes>
</textField>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Enter your City" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="SC9-rY-28Z" customClass="ValidationTextField" customModule="ValidationTextField">
<rect key="frame" x="0.0" y="315" width="315" height="43"/>
<nil key="textColor"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="isShowTitle" value="NO"/>
</userDefinedRuntimeAttributes>
</textField>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Select your Occupation" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="ayn-DP-9bq" customClass="ValidationTextField" customModule="ValidationTextField">
<rect key="frame" x="0.0" y="378" width="315" height="43"/>
<nil key="textColor"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="isShowTitle" value="NO"/>
</userDefinedRuntimeAttributes>
</textField>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="If you have a referralCode" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="srZ-o3-hZr" customClass="ValidationTextField" customModule="ValidationTextField">
<rect key="frame" x="0.0" y="441" width="315" height="43"/>
<color key="tintColor" red="0.78177064659999995" green="0.55228364470000002" blue="0.018981300289999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="textColor"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="14"/>
<textInputTraits key="textInputTraits" autocorrectionType="no" keyboardType="alphabet" returnKeyType="done"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="isShowTitle" value="NO"/>
</userDefinedRuntimeAttributes>
</textField>
</subviews>
<color key="backgroundColor" red="0.90588235289999997" green="0.92941176469999998" blue="0.94901960780000005" alpha="1" colorSpace="calibratedRGB"/>
</stackView>
<button opaque="NO" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="4QD-n7-cbc">
<rect key="frame" x="30" y="700" width="315" height="50"/>
<rect key="frame" x="30" y="574" width="315" height="50"/>
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="50" id="Fgp-3E-J5P"/>
@ -178,11 +149,11 @@
</button>
</subviews>
<constraints>
<constraint firstAttribute="trailing" secondItem="Ulz-yj-JUf" secondAttribute="trailing" constant="30" id="BCE-2o-rVP"/>
<constraint firstItem="4QD-n7-cbc" firstAttribute="width" secondItem="Ulz-yj-JUf" secondAttribute="width" id="D3H-fb-4w9"/>
<constraint firstAttribute="trailing" secondItem="5gp-EN-amE" secondAttribute="trailing" id="Dmc-VK-TLI"/>
<constraint firstItem="Ulz-yj-JUf" firstAttribute="leading" secondItem="dI0-Yl-Sp1" secondAttribute="leading" constant="30" id="EGH-Io-TOf"/>
<constraint firstItem="4QD-n7-cbc" firstAttribute="width" secondItem="QtF-v5-ULz" secondAttribute="width" id="Q1E-YT-9Yt"/>
<constraint firstItem="5gp-EN-amE" firstAttribute="leading" secondItem="dI0-Yl-Sp1" secondAttribute="leading" id="Vr4-q5-8D1"/>
<constraint firstAttribute="trailing" secondItem="QtF-v5-ULz" secondAttribute="trailing" constant="30" id="beD-uE-yPs"/>
<constraint firstItem="QtF-v5-ULz" firstAttribute="leading" secondItem="dI0-Yl-Sp1" secondAttribute="leading" constant="30" id="eWu-S0-m7t"/>
</constraints>
</stackView>
</subviews>
@ -223,8 +194,6 @@
<outlet property="firstNameTextField" destination="wBc-TT-A5d" id="TdG-Ij-0En"/>
<outlet property="genderTextField" destination="jMe-PA-j1d" id="phC-Xc-vtJ"/>
<outlet property="headerTItleLabel" destination="5gp-EN-amE" id="b6E-Sa-Bdq"/>
<outlet property="mobileNumberTextField" destination="e0l-hm-b9a" id="Wm8-Ih-A2H"/>
<outlet property="nativeCountryTextField" destination="cXS-dQ-HBb" id="7G7-fT-Pym"/>
<outlet property="occupationTextField" destination="ayn-DP-9bq" id="Yzu-LO-qYT"/>
<outlet property="provinceTextField" destination="SC9-rY-28Z" id="3vx-ba-VhU"/>
<outlet property="referralCodeTextField" destination="srZ-o3-hZr" id="Q9W-i8-zuD"/>

70
GMERemittance/Module/RegisterModules/KYC/kycForm1/User Interface/View/kycForm1ViewController.swift

@ -63,16 +63,12 @@ class KycForm1ViewController: UIViewController {
struct StringConstants {
let fullname = "full_name_text".localized()
let fullnamePlaceholder = "full_name_placeholder_text".localized()
let mobileNumber = "mobile_number_text".localized()
let mobilePlaceholder = "mobile_number_placeholder_text".localized()
let email = "email_text_optional".localized()
let emailPlaceholder = "placeholder_enter_receiver_email_text".localized()
let dob = "dob_text".localized()
let dobPlaceholder = "select_dob_text".localized()
let gender = "gender_text".localized()
let genderPlacholder = "gender_placeholder_text".localized()
let nativeCountry = "native_country_text".localized()
let nativeCountryPlaceholder = "native_country_placeholder_text".localized()
let addressInKorea = "address_in_korea_text".localized()
let addressPlaceholder = "address_in_korea_text".localized()
let province = "province_text".localized()
@ -85,11 +81,10 @@ class KycForm1ViewController: UIViewController {
let firstNameError = "kyc_first_name_error".localized()
let genderError = "kyc_gender_error".localized()
let emailError = "invalid email".localized()
let nativeCountryError = "kyc_native_country_error".localized()
let addressError = "kyc_address_error".localized()
let occupationError = "kyc_occupation_error".localized()
let provinceError = "kyc_province_error".localized()
let mobileNumberError = "kyc_mobile_invalid_number_error".localized()
let dobError = "dob_valid_error".localized()
}
@ -97,9 +92,7 @@ class KycForm1ViewController: UIViewController {
private var validDic = [
KycForm1FieldKeys.firstName: false,
KycForm1FieldKeys.gender: false,
KycForm1FieldKeys.mobileNumber: false,
KycForm1FieldKeys.email: false,
KycForm1FieldKeys.nativeCountry: false,
KycForm1FieldKeys.address: false,
KycForm1FieldKeys.province: false,
KycForm1FieldKeys.occupation: false,
@ -122,9 +115,7 @@ class KycForm1ViewController: UIViewController {
@IBOutlet weak var firstNameTextField: ValidationTextField!
@IBOutlet weak var genderTextField: ValidationTextField!
@IBOutlet weak var dobTextField: ValidationTextField!
@IBOutlet weak var mobileNumberTextField: ValidationTextField!
@IBOutlet weak var emailTextField: ValidationTextField!
@IBOutlet weak var nativeCountryTextField: ValidationTextField!
@IBOutlet weak var addressTextField: ValidationTextField!
@IBOutlet weak var provinceTextField: ValidationTextField!
@IBOutlet weak var occupationTextField: ValidationTextField!
@ -148,12 +139,13 @@ class KycForm1ViewController: UIViewController {
var errorLabels: [UILabel] = []
var textfields: [UITextField] = []
var delegate: KYCForm1Delegate?
var countries: [KeyValueModel]?
var countries: [NativeCountryModel]?
var occupations: [KeyValueModel]?
var kycModel: KycModel? {
didSet {
self.countries = kycModel?.nativeCountry
// self.countries = kycModel?.nativeCountry
self.countries = StaticModels().nativeCountries
self.occupations = kycModel?.occupations
self.proviences = kycModel?.city
}
@ -163,12 +155,12 @@ class KycForm1ViewController: UIViewController {
var selectedGender: String?
var selectedCountry: SendMoneyCountryViewModel? {
didSet {
self.nativeCountryTextField.text = selectedCountry?.name
nativeCountryTextField.sendActions(for: .editingChanged)
}
}
// var selectedCountry: NativeCountryModel? {
// didSet {
// self.nativeCountryTextField.text = selectedCountry?.text
// nativeCountryTextField.sendActions(for: .editingChanged)
// }
// }
var selectedProvience: KeyValueModel? {
didSet {
@ -233,11 +225,9 @@ class KycForm1ViewController: UIViewController {
removeNonASCII(
textFields: [
self.firstNameTextField,
self.mobileNumberTextField,
self.emailTextField,
self.dobTextField,
self.genderTextField,
self.nativeCountryTextField,
self.addressTextField,
self.provinceTextField,
self.occupationTextField
@ -251,41 +241,38 @@ class KycForm1ViewController: UIViewController {
let titleFont = UIFont(name: "SanFranciscoDisplay-Regular", size: 12)!
self.firstNameTextField.titleText = StringConstants().fullname
self.mobileNumberTextField.titleText = StringConstants().mobileNumber
self.emailTextField.titleText = StringConstants().email
self.dobTextField.titleText = StringConstants().dob
self.genderTextField.titleText = StringConstants().gender
self.nativeCountryTextField.titleText = StringConstants().nativeCountry
self.addressTextField.titleText = StringConstants().addressInKorea
self.provinceTextField.titleText = StringConstants().province
self.occupationTextField.titleText = StringConstants().occupation
self.referralCodeTextField.titleText = StringConstants().referralCode
self.firstNameTextField.placeholder = StringConstants().fullnamePlaceholder
self.mobileNumberTextField.placeholder = StringConstants().mobilePlaceholder
self.emailTextField.placeholder = StringConstants().emailPlaceholder
self.dobTextField.placeholder = StringConstants().dobPlaceholder
self.genderTextField.placeholder = StringConstants().genderPlacholder
self.nativeCountryTextField.placeholder = StringConstants().nativeCountryPlaceholder
self.addressTextField.placeholder = StringConstants().addressPlaceholder
self.provinceTextField.placeholder = StringConstants().provincePlaceholder
self.occupationTextField.placeholder = StringConstants().occupationPlaceholder
self.firstNameTextField.errorMessage = StringConstants().firstNameError
self.mobileNumberTextField.errorMessage = StringConstants().mobileNumberError
self.emailTextField.errorMessage = StringConstants().emailError
self.genderTextField.errorMessage = StringConstants().genderError
self.nativeCountryTextField.errorMessage = StringConstants().nativeCountryError
self.addressTextField.errorMessage = StringConstants().addressError
self.provinceTextField.errorMessage = StringConstants().provinceError
self.occupationTextField.errorMessage = StringConstants().occupationError
self.firstNameTextField.titleFont = titleFont
self.mobileNumberTextField.titleFont = titleFont
self.emailTextField.titleFont = titleFont
self.dobTextField.titleFont = titleFont
self.genderTextField.titleFont = titleFont
self.nativeCountryTextField.titleFont = titleFont
self.addressTextField.titleFont = titleFont
self.provinceTextField.titleFont = titleFont
self.occupationTextField.titleFont = titleFont
@ -294,10 +281,8 @@ class KycForm1ViewController: UIViewController {
private func setError(){
self.firstNameTextField.validCondition = { !$0.isEmpty }
self.mobileNumberTextField.validCondition = { $0.count > 9 && $0.count < 12}
self.emailTextField.validCondition = { $0.isEmail() }
self.genderTextField.validCondition = { !$0.isEmpty }
self.nativeCountryTextField.validCondition = { !$0.isEmpty }
self.addressTextField.validCondition = { !$0.isEmpty }
self.provinceTextField.validCondition = { !$0.isEmpty }
self.occupationTextField.validCondition = { !$0.isEmpty }
@ -316,9 +301,7 @@ class KycForm1ViewController: UIViewController {
self.emailTextField.delegate = self
self.dobTextField.delegate = self
self.addressTextField.delegate = self
self.nativeCountryTextField.delegate = self
self.occupationTextField.delegate = self
self.mobileNumberTextField.delegate = self
self.provinceTextField.delegate = self
}
@ -375,9 +358,6 @@ extension KycForm1ViewController: UITextFieldDelegate {
case genderTextField:
self.showGenderPicker()
return false
case nativeCountryTextField:
self.showCountryPickerview()
return false
case provinceTextField:
self.showProviencePickerview()
return false
@ -394,18 +374,10 @@ extension KycForm1ViewController: UITextFieldDelegate {
extension KycForm1ViewController {
private func showCountryPickerview() {
let _countries = self.countries ?? []
let data: [SendMoneyCountryViewModel] = _countries.map({
let model = SendMoneyCountryViewModel()
model.id = $0.id
model.name = $0.text
return model
})
TablePresenterWireframe().openWith(
tag: 0,
delegate: self,
model: data,
model: countries,
source: self
)
}
@ -518,8 +490,6 @@ extension KycForm1ViewController: TablePresenterDelegate {
func TablePresenterView(_ viewController: TablePresenterViewController, didSelectModel model: TablePresenterProtocol?) {
switch viewController.view.tag {
case 0:
self.selectedCountry = model as? SendMoneyCountryViewModel
case 1:
self.selectedOccupation = model as? KeyValueModel
case 2:
@ -551,16 +521,12 @@ extension KycForm1ViewController {
switch tf {
case firstNameTextField:
validDic[KycForm1FieldKeys.firstName] = tf.isValid
case mobileNumberTextField:
validDic[KycForm1FieldKeys.mobileNumber] = tf.isValid
case emailTextField:
validDic[KycForm1FieldKeys.email] = tf.isValid
case genderTextField:
validDic[KycForm1FieldKeys.gender] = tf.isValid
case dobTextField:
validDic[KycForm1FieldKeys.dob] = tf.isValid
case nativeCountryTextField:
validDic[KycForm1FieldKeys.nativeCountry] = tf.isValid
case addressTextField:
validDic[KycForm1FieldKeys.address] = tf.isValid
case provinceTextField:
@ -581,9 +547,9 @@ extension KycForm1ViewController {
lastName: "",
gender: selectedGender ?? "",
dob: dobTextField.text ?? "",
mobile: mobileNumberTextField.text ?? "",
mobile: GMEDB.shared.user.string(.mobileNumber) ?? "",
email: emailTextField.text ?? "",
nativeCountry: selectedCountry?.id ?? "",
nativeCountry: GMEDB.shared.user.string(.country) ?? "",
country: addressTextField.text ?? "",
province: selectedProvience?.id ?? "",
occupation: selectedOccupation?.id ?? "",

16
GMERemittance/Module/RegisterModules/PennyTest/User Interface/View/PennyTestViewController.swift

@ -107,14 +107,14 @@ class PennyTestViewController: UIViewController {
}
}) { (error) in
// FIXME: FOR TEST
GMEDB.shared.user.set(PennyTestStatusCode.requested.rawValue, .pennyTestStatusCode)
let wireframe = PennyTestSubmitWireframe()
if let navigation = self.navigationController {
wireframe.parentViewController = self
wireframe.pushMainView(in: navigation)
}
// self.hideLoading()
// self.alert(type: .error, message: error.localizedDescription)
// GMEDB.shared.user.set(PennyTestStatusCode.requested.rawValue, .pennyTestStatusCode)
// let wireframe = PennyTestSubmitWireframe()
// if let navigation = self.navigationController {
// wireframe.parentViewController = self
// wireframe.pushMainView(in: navigation)
// }
self.hideLoading()
self.alert(type: .error, message: error.localizedDescription)
}
}

26
GMERemittance/Module/RegisterModules/PennyTestSubmit/User Interface/View/PennyTestSubmitViewController.swift

@ -203,20 +203,20 @@ class PennyTestSubmitViewController: UIViewController {
}) { (error) in
// FIXME: FOR TEST
self.alertWithOk(
type: .normal,
message: "For Test",
title: "Success",
okTitle: "Ok",
style: UIAlertController.Style.alert,
OkStyle: .default,
okAction: {
GMEDB.shared.user.set(PennyTestStatusCode.completed.rawValue, .pennyTestStatusCode)
self.dismiss()
}
)
// self.alertWithOk(
// type: .normal,
// message: "For Test",
// title: "Success",
// okTitle: "Ok",
// style: UIAlertController.Style.alert,
// OkStyle: .default,
// okAction: {
// GMEDB.shared.user.set(PennyTestStatusCode.completed.rawValue, .pennyTestStatusCode)
// self.dismiss()
// }
// )
// self.alert(type: .error, message: error.localizedDescription)
self.alert(type: .error, message: error.localizedDescription)
}
}

83
GMERemittance/Module/RegisterModules/Register/Application Logic/Interactor/RegisterInteractor.swift

@ -21,94 +21,11 @@ class RegisterInteractor {
init(service: RegisterServiceType) {
self.service = service
}
private func isValidPasword(password: String, confirmPassword: String) -> (isValid: Bool, error: String) {
var error = ""
var isValid = true
// >= 9, 1 special character, 1 number
//
// func isValidLength() -> Bool {
// return password.count >= 9
// }
//
// func hasNumber() -> Bool {
// let characterSet = CharacterSet.init(charactersIn: "1234567890")
// return password.rangeOfCharacter(from: characterSet) != nil
// }
//
// func hasLetter() -> Bool {
// let characterSet = CharacterSet.letters
// return password.rangeOfCharacter(from: characterSet) != nil
// }
//
// func hasSpecialCharacter() -> Bool {
// let characterSet = CharacterSet.alphanumerics
// return password.rangeOfCharacter(from: characterSet.inverted) != nil
// }
//
// func hasUpperCase() -> Bool {
// let characterSet = CharacterSet.uppercaseLetters
// return password.rangeOfCharacter(from: characterSet) != nil
// }
//
if password.isEmpty {
error = error + "\n" + "password_empty_error".localized()
isValid = false
}
if confirmPassword.isEmpty {
error = error + "\n" + "password_confirm_empty_error".localized()
isValid = false
}
return (isValid, error)
}
// MARK: Converting entities
private func isValid(userName: String, password: String, confirmPassword: String, dob: String) -> (isValid: Bool, error: Error) {
var error = ""
var isValid = true
// user name
if userName.isEmpty {
error = error + "email_valid_error".localized();
isValid = false
}
if !Utility.isValidEmail(email: userName) {
error = error + "dob_valid_error".localized()
isValid = false
}
let result = self.isValidPasword(password: password, confirmPassword: confirmPassword)
if !result.isValid {
error = error + result.error
isValid = false
}
if dob.isEmpty {
error = error + "\n " + "select_dob_text".localized()
isValid = false
}
let _error = NSError.init(domain: "LoginInteractor", code: 0, userInfo: [NSLocalizedDescriptionKey : error])
return (isValid, _error)
}
}
extension RegisterInteractor: RegisterInteractorInput {
func register(model: RegisterRequestModel) {
let validationResult = self.isValid(userName: model.username ?? "", password: model.encryptedPassword ?? "", confirmPassword: model.encryptedConfirmPassword ?? "", dob: model.dob ?? "")
if !validationResult.isValid {
self.output?.show(error: validationResult.error)
return
}
GMEDB.shared.getFcmToken { (token, error) in
model.uuid = Utility.getUUid()

359
GMERemittance/Module/RegisterModules/Register/User Interface/View/Register.storyboard

@ -1,12 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="HSb-ou-7T5">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<customFonts key="customFonts">
@ -18,207 +17,137 @@
</array>
</customFonts>
<scenes>
<!--Register-->
<scene sceneID="R60-Pu-Hpy">
<!--Register View Controller-->
<scene sceneID="axE-FC-GQ8">
<objects>
<viewController storyboardIdentifier="RegisterViewController" title="Register" id="HSb-ou-7T5" customClass="RegisterViewController" customModule="GME_Remit" customModuleProvider="target" sceneMemberID="viewController">
<viewController storyboardIdentifier="RegisterViewController" id="3of-XY-hDI" customClass="RegisterViewController" customModule="GME_Remit" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="y1H-iV-BwG"/>
<viewControllerLayoutGuide type="bottom" id="PYB-Kq-ghm"/>
<viewControllerLayoutGuide type="top" id="sw6-8e-IPm"/>
<viewControllerLayoutGuide type="bottom" id="G54-ad-f73"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="9Uc-9s-KgO">
<view key="view" contentMode="scaleToFill" id="FaP-85-se4">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="page1_image" translatesAutoresizingMaskIntoConstraints="NO" id="qt8-R6-bZI">
<rect key="frame" x="20" y="592" width="335" height="75"/>
</imageView>
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" keyboardDismissMode="onDrag" translatesAutoresizingMaskIntoConstraints="NO" id="not-sP-jex">
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="KcJ-bG-Puu">
<rect key="frame" x="0.0" y="20" width="375" height="647"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="TMW-5D-0hw">
<rect key="frame" x="0.0" y="0.0" width="375" height="740.5"/>
<view contentMode="scaleToFill" placeholderIntrinsicWidth="375" placeholderIntrinsicHeight="647" translatesAutoresizingMaskIntoConstraints="NO" id="3OB-6d-dKP">
<rect key="frame" x="0.0" y="0.0" width="375" height="653"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Atf-ra-7AT">
<rect key="frame" x="33.5" y="144" width="308" height="325.5"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</view>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="40" translatesAutoresizingMaskIntoConstraints="NO" id="vrJ-M3-5iK">
<rect key="frame" x="33.5" y="10" width="308" height="459.5"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Register to
Global Money Express" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="B0J-XU-dgc">
<rect key="frame" x="20" y="10" width="345" height="70"/>
<constraints>
<constraint firstAttribute="height" constant="70" id="tst-x5-Lc6"/>
</constraints>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Bold" family="San Francisco Display" pointSize="24"/>
<color key="textColor" red="0.92877691979999999" green="0.11067970839999999" blue="0.14004543420000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Register with your email address " textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="boR-7r-ieU">
<rect key="frame" x="0.0" y="90" width="375" height="17"/>
<constraints>
<constraint firstAttribute="height" constant="17" id="S4C-pP-iBt"/>
</constraints>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="14"/>
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Bjy-dd-Sry">
<rect key="frame" x="30" y="127" width="315" height="262"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="gU9-fS-TB7">
<rect key="frame" x="0.0" y="0.0" width="308" height="94"/>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" spacing="30" translatesAutoresizingMaskIntoConstraints="NO" id="AOi-Kv-YDt">
<rect key="frame" x="0.0" y="0.0" width="315" height="262"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="kW9-Tb-ki3">
<rect key="frame" x="0.0" y="0.0" width="308" height="69"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Register to
Global Money Express" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="TWs-xf-6I7">
<rect key="frame" x="0.0" y="0.0" width="308" height="69"/>
<constraints>
<constraint firstAttribute="height" constant="69" id="GTv-QV-Drf"/>
<constraint firstAttribute="width" constant="308" id="g37-0c-FLC"/>
</constraints>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Bold" family="San Francisco Display" pointSize="24"/>
<color key="textColor" red="0.92877691979999999" green="0.11067970839999999" blue="0.14004543420000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Register with your email address " textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="v5s-fa-caD">
<rect key="frame" x="0.0" y="77" width="308" height="17"/>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Enter your ID" textAlignment="natural" minimumFontSize="17" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="wCs-hK-db8" customClass="ValidationTextField" customModule="ValidationTextField">
<rect key="frame" x="0.0" y="0.0" width="315" height="43"/>
<constraints>
<constraint firstAttribute="height" constant="17" id="gFm-hz-IqO"/>
<constraint firstAttribute="height" constant="43" id="tEk-f7-31Y"/>
</constraints>
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="14"/>
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillProportionally" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="DJI-ZZ-kWX">
<rect key="frame" x="0.0" y="134" width="308" height="325.5"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="7" translatesAutoresizingMaskIntoConstraints="NO" id="S1D-Nc-CQS">
<rect key="frame" x="0.0" y="0.0" width="308" height="65"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="User ID" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="RF1-Bx-jNz">
<rect key="frame" x="0.0" y="0.0" width="308" height="15"/>
<constraints>
<constraint firstAttribute="height" constant="15" id="U4l-X1-cc5"/>
</constraints>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="14"/>
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Email" textAlignment="natural" minimumFontSize="17" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="Uss-1a-WgB">
<rect key="frame" x="0.0" y="22" width="308" height="43"/>
<constraints>
<constraint firstAttribute="height" constant="43" id="CjB-7P-lLX"/>
</constraints>
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="14"/>
<textInputTraits key="textInputTraits" autocorrectionType="no" keyboardType="emailAddress"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<integer key="value" value="5"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</textField>
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="7" translatesAutoresizingMaskIntoConstraints="NO" id="XQ2-DQ-GPK">
<rect key="frame" x="0.0" y="75" width="308" height="100.5"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="PasswordPasswordPasswordPasswordPasswordPasswordPasswordPasswordPasswordPasswordPassword" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="XxD-eR-5bJ">
<rect key="frame" x="0.0" y="0.0" width="308" height="50.5"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="14"/>
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Create Password" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="64u-wX-SQo">
<rect key="frame" x="0.0" y="57.5" width="308" height="43"/>
<constraints>
<constraint firstAttribute="height" constant="43" id="v8S-IB-gIP"/>
</constraints>
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="14"/>
<textInputTraits key="textInputTraits" secureTextEntry="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="keyPath" value="YES"/>
</userDefinedRuntimeAttributes>
</textField>
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="7" translatesAutoresizingMaskIntoConstraints="NO" id="PSD-nE-ULu">
<rect key="frame" x="0.0" y="185.5" width="308" height="65"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Confirm Password" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="KBS-4G-SD1">
<rect key="frame" x="0.0" y="0.0" width="308" height="15"/>
<constraints>
<constraint firstAttribute="height" constant="15" id="2TV-Bk-yUv"/>
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="15" id="y7m-hf-pxk"/>
</constraints>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="14"/>
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Confirm Password" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="tpF-H6-N6v">
<rect key="frame" x="0.0" y="22" width="308" height="43"/>
<constraints>
<constraint firstAttribute="height" constant="43" id="PaW-a8-N5z"/>
</constraints>
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="14"/>
<textInputTraits key="textInputTraits" secureTextEntry="YES"/>
</textField>
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="7" translatesAutoresizingMaskIntoConstraints="NO" id="8Nu-iD-eBs">
<rect key="frame" x="0.0" y="260.5" width="308" height="65"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Date Of Birth" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="NFk-sA-zvw">
<rect key="frame" x="0.0" y="0.0" width="308" height="15"/>
<constraints>
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="15" id="9oy-1l-rRE"/>
<constraint firstAttribute="height" constant="15" id="u32-MN-7S7"/>
</constraints>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="14"/>
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Date Of Birth" textAlignment="natural" minimumFontSize="17" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="rNx-p8-4EG">
<rect key="frame" x="0.0" y="22" width="308" height="43"/>
<constraints>
<constraint firstAttribute="height" constant="43" id="tZ3-Y0-teL"/>
</constraints>
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
</subviews>
</stackView>
<textInputTraits key="textInputTraits" keyboardType="alphabet"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<integer key="value" value="5"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="boolean" keyPath="isShowTitle" value="NO"/>
</userDefinedRuntimeAttributes>
</textField>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Create Password" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="IAX-yY-Q4P" customClass="ValidationTextField" customModule="ValidationTextField">
<rect key="frame" x="0.0" y="73" width="315" height="43"/>
<constraints>
<constraint firstAttribute="height" constant="43" id="i84-oj-die"/>
</constraints>
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="14"/>
<textInputTraits key="textInputTraits" secureTextEntry="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="keyPath" value="YES"/>
<userDefinedRuntimeAttribute type="boolean" keyPath="isShowTitle" value="NO"/>
</userDefinedRuntimeAttributes>
</textField>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Select Native Country" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="iE3-T8-5se" customClass="ValidationTextField" customModule="ValidationTextField">
<rect key="frame" x="0.0" y="146" width="315" height="43"/>
<constraints>
<constraint firstAttribute="height" constant="43" id="R31-jm-Puv"/>
</constraints>
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="isShowTitle" value="NO"/>
</userDefinedRuntimeAttributes>
</textField>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Enter your Mobile No" textAlignment="natural" minimumFontSize="17" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="VWH-eY-0B8" customClass="ValidationTextField" customModule="ValidationTextField">
<rect key="frame" x="0.0" y="219" width="315" height="43"/>
<constraints>
<constraint firstAttribute="height" constant="43" id="ZCg-c0-8tI"/>
</constraints>
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="14"/>
<textInputTraits key="textInputTraits" keyboardType="phonePad"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="isShowTitle" value="NO"/>
</userDefinedRuntimeAttributes>
</textField>
</subviews>
</stackView>
</subviews>
</stackView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="uDy-XD-Zh8">
<rect key="frame" x="89" y="489.5" width="203.5" height="26"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="AOi-Kv-YDt" secondAttribute="bottom" id="aDE-Fi-fIJ"/>
<constraint firstItem="AOi-Kv-YDt" firstAttribute="top" secondItem="Bjy-dd-Sry" secondAttribute="top" id="hp0-UP-uYX"/>
<constraint firstItem="AOi-Kv-YDt" firstAttribute="leading" secondItem="Bjy-dd-Sry" secondAttribute="leading" id="xCP-Rq-eZB"/>
<constraint firstAttribute="trailing" secondItem="AOi-Kv-YDt" secondAttribute="trailing" id="zE7-dT-ves"/>
</constraints>
</view>
<stackView opaque="NO" contentMode="scaleToFill" spacing="7" translatesAutoresizingMaskIntoConstraints="NO" id="ZBz-Fk-d28">
<rect key="frame" x="90.5" y="419" width="194.5" height="29"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Already have an Account?" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="T2p-yQ-5An">
<rect key="frame" x="4" y="2" width="153.5" height="22"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Already have an Account?" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="YgA-Df-6ht">
<rect key="frame" x="0.0" y="0.0" width="153.5" height="29"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="14"/>
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="QPQ-DX-Gea">
<rect key="frame" x="165.5" y="0.0" width="34" height="26"/>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="6Ho-mR-LaI">
<rect key="frame" x="160.5" y="0.0" width="34" height="29"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="14"/>
<state key="normal" title="Login">
<color key="titleColor" red="0.18039215689999999" green="0.19215686269999999" blue="0.57254901960000004" alpha="1" colorSpace="calibratedRGB"/>
</state>
<connections>
<action selector="login:" destination="HSb-ou-7T5" eventType="touchUpInside" id="x2s-dt-cf0"/>
<action selector="login:" destination="3of-XY-hDI" eventType="touchUpInside" id="QnE-FB-2eq"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="T2p-yQ-5An" secondAttribute="bottom" constant="2" id="75d-xQ-cjQ"/>
<constraint firstAttribute="trailing" secondItem="QPQ-DX-Gea" secondAttribute="trailing" constant="4" id="IOY-6S-NIe"/>
<constraint firstItem="T2p-yQ-5An" firstAttribute="leading" secondItem="uDy-XD-Zh8" secondAttribute="leading" constant="4" id="MM1-PO-E8d"/>
<constraint firstItem="QPQ-DX-Gea" firstAttribute="top" secondItem="uDy-XD-Zh8" secondAttribute="top" id="RLY-Cf-Ahf"/>
<constraint firstItem="QPQ-DX-Gea" firstAttribute="leading" secondItem="T2p-yQ-5An" secondAttribute="trailing" constant="8" id="WE2-XV-k39"/>
<constraint firstAttribute="bottom" secondItem="QPQ-DX-Gea" secondAttribute="bottom" id="kzW-Uy-jVf"/>
<constraint firstAttribute="height" constant="26" id="zgb-yb-JBV"/>
<constraint firstItem="T2p-yQ-5An" firstAttribute="top" secondItem="uDy-XD-Zh8" secondAttribute="top" constant="2" id="zjl-Vg-REZ"/>
</constraints>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ruL-lG-yjF">
<rect key="frame" x="87.5" y="544.5" width="200" height="50"/>
<color key="backgroundColor" red="0.92941176469999998" green="0.10980392160000001" blue="0.14117647059999999" alpha="1" colorSpace="calibratedRGB"/>
</stackView>
<button opaque="NO" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="UTk-Hw-z4V">
<rect key="frame" x="30" y="498" width="315" height="50"/>
<color key="backgroundColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="50" id="VQy-Cr-Jes"/>
<constraint firstAttribute="width" constant="200" id="YfG-qT-zNy"/>
<constraint firstAttribute="height" constant="50" id="D1y-Yp-R3h"/>
</constraints>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="18"/>
<state key="normal" title="Register">
@ -230,68 +159,68 @@
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<action selector="register:" destination="HSb-ou-7T5" eventType="touchUpInside" id="mqy-VU-vNC"/>
<action selector="register:" destination="3of-XY-hDI" eventType="touchUpInside" id="feI-5u-0dl"/>
</connections>
</button>
<imageView hidden="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="page1_image" translatesAutoresizingMaskIntoConstraints="NO" id="tyu-eZ-ROR">
<rect key="frame" x="15" y="578" width="345" height="75"/>
</imageView>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="vrJ-M3-5iK" firstAttribute="top" secondItem="Qj5-Tz-cjD" secondAttribute="top" constant="10" id="8Sm-bM-52a"/>
<constraint firstItem="uDy-XD-Zh8" firstAttribute="top" secondItem="vrJ-M3-5iK" secondAttribute="bottom" constant="20" id="E5f-u9-hKN"/>
<constraint firstItem="Atf-ra-7AT" firstAttribute="trailing" secondItem="DJI-ZZ-kWX" secondAttribute="trailing" id="Hyc-cr-fY9"/>
<constraint firstItem="Atf-ra-7AT" firstAttribute="top" secondItem="DJI-ZZ-kWX" secondAttribute="top" id="Ibb-f6-Yaf"/>
<constraint firstItem="uDy-XD-Zh8" firstAttribute="centerX" secondItem="TMW-5D-0hw" secondAttribute="centerX" constant="3" id="M5y-Kg-bad"/>
<constraint firstItem="ruL-lG-yjF" firstAttribute="top" secondItem="uDy-XD-Zh8" secondAttribute="bottom" constant="29" id="Z7l-91-cMl"/>
<constraint firstAttribute="bottom" secondItem="ruL-lG-yjF" secondAttribute="bottom" priority="250" constant="146" id="cOb-0s-AFE"/>
<constraint firstItem="Atf-ra-7AT" firstAttribute="leading" secondItem="DJI-ZZ-kWX" secondAttribute="leading" id="eQq-kE-yBx"/>
<constraint firstItem="Atf-ra-7AT" firstAttribute="bottom" secondItem="DJI-ZZ-kWX" secondAttribute="bottom" id="iJl-M7-n74"/>
<constraint firstItem="vrJ-M3-5iK" firstAttribute="centerX" secondItem="TMW-5D-0hw" secondAttribute="centerX" id="p7R-us-Zjp"/>
<constraint firstItem="ruL-lG-yjF" firstAttribute="centerX" secondItem="TMW-5D-0hw" secondAttribute="centerX" id="pCV-8t-3yI"/>
<constraint firstItem="B0J-XU-dgc" firstAttribute="leading" secondItem="3OB-6d-dKP" secondAttribute="leading" constant="20" id="2CQ-5v-uKy"/>
<constraint firstItem="tyu-eZ-ROR" firstAttribute="top" secondItem="UTk-Hw-z4V" secondAttribute="bottom" constant="30" id="2gt-fi-u3y"/>
<constraint firstAttribute="bottom" secondItem="tyu-eZ-ROR" secondAttribute="bottom" id="3lt-hf-dg2"/>
<constraint firstItem="ZBz-Fk-d28" firstAttribute="centerX" secondItem="3OB-6d-dKP" secondAttribute="centerX" id="8Kc-ht-cCT"/>
<constraint firstItem="boR-7r-ieU" firstAttribute="top" secondItem="B0J-XU-dgc" secondAttribute="bottom" constant="10" id="A7V-GZ-hJe"/>
<constraint firstAttribute="trailing" secondItem="B0J-XU-dgc" secondAttribute="trailing" constant="10" id="C45-4d-gOx"/>
<constraint firstItem="boR-7r-ieU" firstAttribute="leading" secondItem="3OB-6d-dKP" secondAttribute="leading" id="Htv-9h-4tB"/>
<constraint firstItem="B0J-XU-dgc" firstAttribute="top" secondItem="3OB-6d-dKP" secondAttribute="top" constant="10" id="KXY-wX-uKW"/>
<constraint firstItem="tyu-eZ-ROR" firstAttribute="leading" secondItem="3OB-6d-dKP" secondAttribute="leading" constant="15" id="S82-zy-zb3"/>
<constraint firstAttribute="trailing" secondItem="tyu-eZ-ROR" secondAttribute="trailing" constant="15" id="TDY-30-KBt"/>
<constraint firstItem="UTk-Hw-z4V" firstAttribute="leading" secondItem="3OB-6d-dKP" secondAttribute="leading" constant="30" id="Te2-YN-rzr"/>
<constraint firstAttribute="trailing" secondItem="UTk-Hw-z4V" secondAttribute="trailing" constant="30" id="Wzt-Hj-YGS"/>
<constraint firstItem="Bjy-dd-Sry" firstAttribute="leading" secondItem="3OB-6d-dKP" secondAttribute="leading" constant="30" id="aCp-rH-2Xa"/>
<constraint firstAttribute="trailing" secondItem="Bjy-dd-Sry" secondAttribute="trailing" constant="30" id="buN-jV-IJy"/>
<constraint firstItem="ZBz-Fk-d28" firstAttribute="top" secondItem="Bjy-dd-Sry" secondAttribute="bottom" constant="30" id="dYd-zI-Rgx"/>
<constraint firstAttribute="trailing" secondItem="boR-7r-ieU" secondAttribute="trailing" id="id1-LR-AFb"/>
<constraint firstItem="Bjy-dd-Sry" firstAttribute="top" secondItem="boR-7r-ieU" secondAttribute="bottom" constant="20" id="ijT-9t-ocC"/>
<constraint firstItem="UTk-Hw-z4V" firstAttribute="top" secondItem="ZBz-Fk-d28" secondAttribute="bottom" constant="50" id="pp5-xZ-yUi"/>
</constraints>
<viewLayoutGuide key="safeArea" id="Qj5-Tz-cjD"/>
</view>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="TMW-5D-0hw" firstAttribute="leading" secondItem="not-sP-jex" secondAttribute="leading" id="a56-FE-e4a"/>
<constraint firstItem="TMW-5D-0hw" firstAttribute="top" secondItem="not-sP-jex" secondAttribute="top" id="gHJ-Xg-YqM"/>
<constraint firstAttribute="bottom" secondItem="TMW-5D-0hw" secondAttribute="bottom" id="gQL-Bl-cCv"/>
<constraint firstItem="TMW-5D-0hw" firstAttribute="width" secondItem="not-sP-jex" secondAttribute="width" id="j2K-P8-hMQ"/>
<constraint firstAttribute="trailing" secondItem="TMW-5D-0hw" secondAttribute="trailing" id="sZ2-5O-9Hq"/>
<constraint firstAttribute="bottom" secondItem="3OB-6d-dKP" secondAttribute="bottom" id="6ZB-xh-gcF"/>
<constraint firstItem="3OB-6d-dKP" firstAttribute="top" secondItem="KcJ-bG-Puu" secondAttribute="top" id="CxH-ke-t5C"/>
<constraint firstItem="3OB-6d-dKP" firstAttribute="width" secondItem="KcJ-bG-Puu" secondAttribute="width" id="Rfp-uE-NI6"/>
<constraint firstAttribute="trailing" secondItem="3OB-6d-dKP" secondAttribute="trailing" id="SJ9-Jf-n1A"/>
<constraint firstItem="3OB-6d-dKP" firstAttribute="leading" secondItem="KcJ-bG-Puu" secondAttribute="leading" id="t62-zN-kfF"/>
</constraints>
</scrollView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="qt8-R6-bZI" firstAttribute="leading" secondItem="9Uc-9s-KgO" secondAttribute="leading" constant="20" id="Ek4-cs-qA2"/>
<constraint firstAttribute="trailing" secondItem="not-sP-jex" secondAttribute="trailing" id="Oco-GX-FAN"/>
<constraint firstItem="not-sP-jex" firstAttribute="top" secondItem="y1H-iV-BwG" secondAttribute="bottom" id="a12-Gb-uta"/>
<constraint firstItem="PYB-Kq-ghm" firstAttribute="top" secondItem="qt8-R6-bZI" secondAttribute="bottom" id="cUJ-uI-YMC"/>
<constraint firstItem="PYB-Kq-ghm" firstAttribute="top" secondItem="not-sP-jex" secondAttribute="bottom" id="d7z-9K-WIc"/>
<constraint firstAttribute="trailing" secondItem="qt8-R6-bZI" secondAttribute="trailing" constant="20" id="e2c-s2-kEt"/>
<constraint firstItem="not-sP-jex" firstAttribute="width" secondItem="9Uc-9s-KgO" secondAttribute="width" id="sGr-ON-rqP"/>
<constraint firstItem="not-sP-jex" firstAttribute="leading" secondItem="9Uc-9s-KgO" secondAttribute="leading" id="umP-3b-JdU"/>
<constraint firstItem="KcJ-bG-Puu" firstAttribute="leading" secondItem="FaP-85-se4" secondAttribute="leading" id="URP-v5-s7W"/>
<constraint firstItem="G54-ad-f73" firstAttribute="top" secondItem="KcJ-bG-Puu" secondAttribute="bottom" id="fEU-Pl-0zu"/>
<constraint firstItem="KcJ-bG-Puu" firstAttribute="top" secondItem="sw6-8e-IPm" secondAttribute="bottom" id="i2C-Eg-N3F"/>
<constraint firstAttribute="trailing" secondItem="KcJ-bG-Puu" secondAttribute="trailing" id="sNJ-JV-suI"/>
</constraints>
</view>
<connections>
<outlet property="alreadyHaveAccountLabel" destination="T2p-yQ-5An" id="Dyd-Gi-faR"/>
<outlet property="confirmPasswordTextfield" destination="tpF-H6-N6v" id="USd-4c-CxC"/>
<outlet property="confirmPasswordTitleLabel" destination="KBS-4G-SD1" id="0CN-mQ-dUQ"/>
<outlet property="dobTextField" destination="rNx-p8-4EG" id="hId-km-pVj"/>
<outlet property="dobTitileLabel" destination="NFk-sA-zvw" id="oYX-pD-SFA"/>
<outlet property="emailTextField" destination="Uss-1a-WgB" id="ydw-Kw-qnw"/>
<outlet property="headerLabel" destination="TWs-xf-6I7" id="8uQ-sr-pWU"/>
<outlet property="loginButton" destination="QPQ-DX-Gea" id="w3G-QP-w8S"/>
<outlet property="passwordTextField" destination="64u-wX-SQo" id="UiS-Nz-5PI"/>
<outlet property="passwordTitleLabel" destination="XxD-eR-5bJ" id="fpS-YJ-2no"/>
<outlet property="registerButton" destination="ruL-lG-yjF" id="IAf-R2-Hyj"/>
<outlet property="subHeaderLabel" destination="v5s-fa-caD" id="Sv0-m3-2ou"/>
<outlet property="userIdTitleLabel" destination="RF1-Bx-jNz" id="d8z-BJ-3ih"/>
<outlet property="alreadyHaveAccountLabel" destination="YgA-Df-6ht" id="EgR-97-xak"/>
<outlet property="headerLabel" destination="B0J-XU-dgc" id="K2o-53-lm5"/>
<outlet property="idTextField" destination="wCs-hK-db8" id="Ogo-4f-5gq"/>
<outlet property="loginButton" destination="6Ho-mR-LaI" id="xmf-uO-jBq"/>
<outlet property="mobileTextField" destination="VWH-eY-0B8" id="xSV-Af-GL0"/>
<outlet property="nativeCountryTextField" destination="iE3-T8-5se" id="PfO-YC-hWd"/>
<outlet property="passwordTextField" destination="IAX-yY-Q4P" id="tGu-Pz-itg"/>
<outlet property="registerButton" destination="UTk-Hw-z4V" id="yVS-bH-Ga0"/>
<outlet property="subHeaderLabel" destination="boR-7r-ieU" id="jO0-2C-r06"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="8je-5K-XuW" userLabel="First Responder" sceneMemberID="firstResponder"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="Paq-Ht-4ju" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-91" y="233"/>
<point key="canvasLocation" x="-382" y="243"/>
</scene>
</scenes>
<resources>

533
GMERemittance/Module/RegisterModules/Register/User Interface/View/RegisterViewController.swift

@ -8,333 +8,284 @@
import UIKit
import Localize_Swift
import ValidationTextField
class RegisterViewController: UIViewController {
struct StringConstants {
let userIdTitle = "userid_title_text".localized()
let useridPlaceholder = "userid_placeholder_text".localized()
let useridError = "userid_error_text".localized()
let passwordTitle = "password_text".localized()
let passwordPlaceholder = "create_password_text".localized()
let passwordError = "password_policy_error".localized()
struct StringConstants {
let userIdTitle = "login_user_id_text".localized()
let useridPlaceholder = "email_text".localized()
let passwordTitle = "password_text".localized()
let passwordPlaceholder = "create_password_text".localized()
let confirmPasswordTitle = "confirm_password_text".localized()
let confirmPasswordPlaceholder = "confirm_password_text".localized()
let dobTitlePlaceholder = "dob_text".localized()
let alreadyHaveAccountText = "already_have_account_text".localized()
let loginText = "login_text".localized()
let registerText = "register_text".localized()
let registerHeader = "register_title_text".localized()
let registerSubtitle = "register_subtitle_text".localized()
}
// MARK: IBOutlets
@IBOutlet weak var emailTextField: UITextField!
@IBOutlet weak var passwordTextField: UITextField!
@IBOutlet weak var confirmPasswordTextfield: UITextField!
@IBOutlet weak var dobTextField: UITextField!
// header labels
@IBOutlet weak var headerLabel: UILabel!
@IBOutlet weak var subHeaderLabel: UILabel!
// title labels
@IBOutlet weak var userIdTitleLabel: UILabel!
@IBOutlet weak var passwordTitleLabel: UILabel!
@IBOutlet weak var confirmPasswordTitleLabel: UILabel!
@IBOutlet weak var dobTitileLabel: UILabel!
@IBOutlet weak var alreadyHaveAccountLabel: UILabel!
// buttons
@IBOutlet weak var loginButton: UIButton!
@IBOutlet weak var registerButton: UIButton!
// MARK: Properties
let datePicker = UIDatePicker()
var presenter: RegisterModuleInterface?
let confirmPasswordTitle = "confirm_password_text".localized()
let confirmPasswordPlaceholder = "confirm_password_text".localized()
// keyboard
var mQwertyTransKeyView : TransKeyView?
var mNumberTransKeyView : TransKeyView?
let dobTitlePlaceholder = "dob_text".localized()
let alreadyHaveAccountText = "already_have_account_text".localized()
let loginText = "login_text".localized()
let registerText = "register_text".localized()
let registerHeader = "register_title_text".localized()
let registerSubtitle = "register_subtitle_text".localized()
var secureKey : NSData!
var numberCipherString : String!
var qwertyCipherString : String!
let mobileNumber = "mobile_number_text".localized()
let mobilePlaceholder = "mobile_number_placeholder_text".localized()
var isTranskeyShowing : Bool!
var isShowQwerty : Bool! = true
var isShowNumber : Bool!
let nativeCountry = "native_country_text".localized()
let nativeCountryPlaceholder = "native_country_placeholder_text".localized()
var password: String! {
didSet {
self.passwordTextField.text = password
}
let nativeCountryError = "kyc_native_country_error".localized()
let mobileNumberError = "kyc_mobile_invalid_number_error".localized()
}
// MARK: IBOutlets
@IBOutlet weak var idTextField: ValidationTextField!
@IBOutlet weak var passwordTextField: ValidationTextField!
@IBOutlet weak var nativeCountryTextField: ValidationTextField!
@IBOutlet weak var mobileTextField: ValidationTextField!
// header labels
@IBOutlet weak var headerLabel: UILabel!
@IBOutlet weak var subHeaderLabel: UILabel!
@IBOutlet weak var alreadyHaveAccountLabel: UILabel!
// buttons
@IBOutlet weak var loginButton: UIButton!
@IBOutlet weak var registerButton: UIButton!
// MARK: Properties
var presenter: RegisterModuleInterface?
private var encryptedPassword: String = ""
private lazy var countries = StaticModels().nativeCountries
private var validDic = [
"id": false,
"password": false,
"country": false,
"mobile": false
]
private var selectedNativeCountry: NativeCountryModel? {
didSet {
nativeCountryTextField.text = selectedNativeCountry?.text
nativeCountryTextField.sendActions(for: .editingChanged)
}
var encryptedPassword: String!
var encryptedConfirmPassword: String!
var confirmPassword: String! {
didSet {
self.confirmPasswordTextfield.text = confirmPassword
}
}
private var isValid = false {
didSet{
registerButton.isEnabled = isValid
registerButton.backgroundColor = isValid ? AppConstants.themeRedColor : .lightGray
}
}
// MARK: VC's Life cycle
override func viewDidLoad() {
super.viewDidLoad()
self.setup()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
self.setupPicturedNavBar()
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
self.navigationItem.title = ""
}
// MARK: IBActions
@IBAction func login(_ sender: UIButton) {
self.presenter?.login()
}
@IBAction func register(_ sender: UIButton) {
let model = RegisterRequestModel()
model.username = idTextField.text
model.encryptedPassword = encryptedPassword
model.nativeCountry = selectedNativeCountry?.id
model.mobileNumber = mobileTextField.text
var showingPasswordField = false
var showingConfirmPasswordField: Bool = false
// MARK: VC's Life cycle
self.presenter?.register(model: model)
}
// MARK: Other Functions
private func setup() {
// all setup should be done here
setupPicturedNavBar()
configureLanguage()
override func viewDidLoad() {
super.viewDidLoad()
self.setupKeyboard()
self.setup()
}
passwordTextField.delegate = self
nativeCountryTextField.delegate = self
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
self.setupPicturedNavBar()
}
passwordTextField.inputView = UIView()
nativeCountryTextField.inputView = UIView()
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
self.navigationItem.title = ""
mQwertyTransKeyView?.mTK_ClearDelegateSubviews()
mNumberTransKeyView?.mTK_ClearDelegateSubviews()
if isTranskeyShowing == false {
mQwertyTransKeyView?.delegate = nil;
mNumberTransKeyView?.delegate = nil;
}
}
removeNonASCII(
textFields: [
idTextField,
passwordTextField,
nativeCountryTextField,
mobileTextField
]
)
// MARK: IBActions
registerButton.layer.cornerRadius = 10
@IBAction func login(_ sender: UIButton) {
self.presenter?.login()
}
}
private func configureLanguage() {
let font = UIFont.init(name: "SanFranciscoDisplay-regular", size: 12)!
private func setupDatePicker() {
self.datePicker.datePickerMode = .date
self.dobTextField.inputView = datePicker
datePicker.maximumDate = Date()
self.datePicker.addTarget(self, action: #selector(handleDatePicker(sender:)), for: .valueChanged)
}
headerLabel.text = StringConstants().registerHeader
subHeaderLabel.text = StringConstants().registerSubtitle
alreadyHaveAccountLabel.text = StringConstants().alreadyHaveAccountText
@objc private func handleDatePicker(sender: UIDatePicker) {
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "yyyy-MM-dd"
self.dobTextField.text = dateFormatter.string(from: sender.date)
}
@IBAction func register(_ sender: UIButton) {
let email = self.emailTextField.text!
// let password = self.passwordTextField.text!
let password = self.password
let dob = self.dobTextField.text!
let confirmPassword = self.confirmPasswordTextfield.text!
let model = RegisterRequestModel()
model.username = email
model.password = password
model.encryptedConfirmPassword = self.encryptedConfirmPassword
model.confirmPassword = confirmPassword
model.dob = dob
model.encryptedPassword = self.encryptedPassword
self.presenter?.register(model: model)
}
idTextField.titleText = StringConstants().userIdTitle
idTextField.titleFont = font
idTextField.placeholder = StringConstants().useridPlaceholder
idTextField.errorMessage = StringConstants().useridError
idTextField.validCondition = {$0.count > 5}
// MARK: Other Functions
passwordTextField.titleText = StringConstants().passwordTitle
passwordTextField.titleFont = font
passwordTextField.placeholder = StringConstants().passwordPlaceholder
passwordTextField.errorMessage = StringConstants().passwordError
passwordTextField.validCondition = { $0.count > 5 }
nativeCountryTextField.titleText = StringConstants().nativeCountry
nativeCountryTextField.titleFont = font
nativeCountryTextField.placeholder = StringConstants().nativeCountryPlaceholder
nativeCountryTextField.errorMessage = StringConstants().nativeCountryError
nativeCountryTextField.validCondition = { !$0.isEmpty }
func setupKeyboard() {
isShowNumber = false
isShowQwerty = true
isTranskeyShowing = false
setQwertyTranskey()
// self.showQwertyTranskeyAction()
}
mobileTextField.titleText = StringConstants().mobileNumber
mobileTextField.titleFont = font
mobileTextField.placeholder = StringConstants().mobilePlaceholder
mobileTextField.errorMessage = StringConstants().mobileNumberError
mobileTextField.validCondition = { $0.count > 9 && $0.count < 12}
func setQwertyTranskey(){
mQwertyTransKeyView = TransKeyView()
mQwertyTransKeyView?.mTK_Init(self)
mQwertyTransKeyView?.delegate = self
mQwertyTransKeyView?.mTK_MakeSecureKey()
mQwertyTransKeyView?.mTK_Supported(byDeviceOrientation: SupportedByDevicePortrait)
mQwertyTransKeyView?.mTK_EnableSamekeyInputDataEncrypt(false)
// ccr key
mQwertyTransKeyView?.mTK_LicenseCheck("license_mtranskey")
loginButton.setTitle(StringConstants().loginText, for: .normal)
registerButton.setTitle(StringConstants().registerText, for: .normal)
}
private func showCountryPickerview() {
TablePresenterWireframe().openWith(
tag: 0,
delegate: self,
model: countries,
source: self
)
}
private func removeNonASCII(textFields: [UITextField]) {
textFields.forEach {
$0.addTarget(self, action: #selector(editingChanged(_:)), for: .editingChanged)
}
}
@objc private func editingChanged(_ textField: UITextField) {
textField.removeNonASCII()
private func setup() {
// all setup should be done here
self.setupPicturedNavBar()
self.setupDatePicker()
self.configureLanguage()
self.passwordTextField.delegate = self
self.confirmPasswordTextfield.delegate = self
}
let tf = textField as! ValidationTextField
private func configureLanguage() {
self.headerLabel.text = StringConstants().registerHeader
self.subHeaderLabel.text = StringConstants().registerSubtitle
self.userIdTitleLabel.text = "email_text".localized()
self.emailTextField.placeholder = StringConstants().useridPlaceholder
let passwordPlaceholder = StringConstants().passwordPlaceholder
let attributedPasswordPlaceholder = NSMutableAttributedString(string: passwordPlaceholder)
let passwordPolicy = " (\("password_policy_error".localized()))"
let font = UIFont.init(name: "SanFranciscoDisplay-regular", size: 12)!
let myAttribute = [ NSAttributedString.Key.foregroundColor: UIColor.lightGray, NSAttributedString.Key.font : font ]
let attributedPasswordPolicy = NSAttributedString(string: passwordPolicy, attributes: myAttribute)
attributedPasswordPlaceholder.append(attributedPasswordPolicy)
self.passwordTitleLabel.attributedText = attributedPasswordPlaceholder
self.passwordTextField.placeholder = StringConstants().passwordPlaceholder
self.confirmPasswordTitleLabel.text = StringConstants().confirmPasswordPlaceholder
self.confirmPasswordTextfield.placeholder = StringConstants().confirmPasswordPlaceholder
self.dobTitileLabel.text = StringConstants().dobTitlePlaceholder
self.dobTextField.placeholder = StringConstants().dobTitlePlaceholder
self.alreadyHaveAccountLabel.text = StringConstants().alreadyHaveAccountText
self.loginButton.setTitle(StringConstants().loginText, for: .normal)
self.registerButton.setTitle(StringConstants().registerText, for: .normal)
switch tf {
case idTextField:
validDic["id"] = tf.isValid
case passwordTextField:
validDic["password"] = tf.isValid
case nativeCountryTextField:
validDic["country"] = tf.isValid
case mobileTextField:
validDic["mobile"] = tf.isValid
default:
break
}
isValid = validDic.reduce(true){ $0 && $1.value}
}
}
// MARK: RegisterViewInterface
extension RegisterViewController: RegisterViewInterface {
func showLoading() {
self.showProgressHud()
}
func hideLoading() {
self.hideProgressHud()
}
func show(error: String) {
self.alert(type: .error, message: error)
}
func show(message: String) {
self.alertWithOk(type: .normal, message: message, title: "Success", okTitle: "Ok") {
self.presenter?.login()
}
func showLoading() {
self.showProgressHud()
}
func hideLoading() {
self.hideProgressHud()
}
func show(error: String) {
self.alert(type: .error, message: error)
}
func show(message: String) {
self.alertWithOk(type: .normal, message: message, title: "Success", okTitle: "Ok") {
self.presenter?.login()
}
}
}
extension RegisterViewController: TransKeyViewDelegate {
func secureInputFinish(_ type: Int) {
NSLog("secureInputFinish Btn Type : %d", type)
NSLog("secureInputFinish");
var targetView : TransKeyView?
NSLog("qwerty : " + isShowQwerty.description + " number : " + isShowNumber.description)
if isShowQwerty == true{
qwertyCipherString = mQwertyTransKeyView?.mTK_GetSecureData()
if showingPasswordField {
if mQwertyTransKeyView?.mTK_GetDataLength() == 0 {
self.encryptedPassword = ""
self.passwordTextField.text = ""
}else {
self.encryptedPassword = qwertyCipherString
self.passwordTextField.text = "password"
} }
if showingConfirmPasswordField {
if mQwertyTransKeyView?.mTK_GetDataLength() == 0 {
encryptedConfirmPassword = ""
self.confirmPasswordTextfield.text = ""
}else {
encryptedConfirmPassword = qwertyCipherString
self.confirmPasswordTextfield.text = "password"
}
}
targetView = mQwertyTransKeyView
// self.mQwertyTransKeyView?.dismissViewControllerAnimated(true, completion: nil)
}
isShowQwerty = false
isShowNumber = false
isTranskeyShowing = false
targetView?.dismiss(animated: true, completion: nil)
// MARK: - UITextFieldDelegate
extension RegisterViewController: UITextFieldDelegate {
func textFieldShouldBeginEditing(_ textField: UITextField) -> Bool {
switch textField {
case passwordTextField:
let secureKeypad = SecureKeypad(target: self)
secureKeypad.delegate = self
secureKeypad.present(animated: true)
return false
case nativeCountryTextField:
showCountryPickerview()
return false
default:
return true
}
}
}
// MARK: - SecureKeypadDelegate
extension RegisterViewController: SecureKeypadDelegate {
func didComplete(_ encryptedString: String, length: Int) {
encryptedPassword = encryptedString
var garbagePassword = ""
func showQwertyPasswordTranskeyAction(){
// let pbkdfKey = "acc4af609fad57f1cd870a5d94092a24be5fd974"
//// let salts = { 1, 6, 0, 7, 4, 4, 4, 4, 8, 8, 7, 1, 4, 3, 3, 3, 3, 3, 3, 3}
// var PBKDF2_SALT : NSData!
// let PBKDF2_IT = 512;
// mQwertyTransKeyView?.mTK_SetPBKDF_RandKey(<#T##randkey: NSData!##NSData!#>)
// setQwertyTranskey()
if mQwertyTransKeyView?.isBeingPresented == false {
isShowQwerty = true
isTranskeyShowing = true
let hintStr = String(format:"password", 0)
let font = UIFont(name: "Arial", size: 15)
mQwertyTransKeyView?.mTK_SetHint(hintStr, font: font)
mQwertyTransKeyView?.mTK_ShowMessageIfMaxLength("16자리 입력이 초과되었습니다.")
mQwertyTransKeyView?.mTK_UseCursor(true)
mQwertyTransKeyView?.mTK_UseAllDeleteButton(true)
mQwertyTransKeyView?.mTK_UseNavigationBar(true)
mQwertyTransKeyView?.mTK_UseVoiceOver(true)
mQwertyTransKeyView?.mTK_setHideInputPasswordDelay(3)
mQwertyTransKeyView?.mTK_SetControlCenter(false)
mQwertyTransKeyView?.mTK_setIgnoreStatusbar(false)
// mQwertyTransKeyView?.mTK_SetLanguage(1)
mQwertyTransKeyView?.mTK_Supported(byDeviceOrientation: SupportedByDevicePortraitAndLandscape)
mQwertyTransKeyView?.mTK_UseShiftOptional(true)
mQwertyTransKeyView?.setKeyboardType(self,
keypadType: 0,
mTK_inputType: 2,
mTK_inputTitle: "password",
mTK_cryptType: 0,
mTK_maxLength: 100,
mTK_minLength: 0,
mTK_keypadUpper: false,
mTK_languageType: 1)
mQwertyTransKeyView?.mTK_EnableSamekeyInputDataEncrypt(false)
mQwertyTransKeyView?.mTK_SetUseBalloonImageButton(true)
if let mQwertyTransKeyView = mQwertyTransKeyView {
self.present(mQwertyTransKeyView, animated: true, completion: nil)
}
}
for _ in 0..<length {
garbagePassword += "*"
}
passwordTextField.text = garbagePassword
// passwordTextField.isEditing = true
passwordTextField.sendActions(for: .editingChanged)
}
}
extension RegisterViewController: UITextFieldDelegate {
func textFieldShouldBeginEditing(_ textField: UITextField) -> Bool {
if textField == passwordTextField {
self.showingPasswordField = true
self.showingConfirmPasswordField = false
self.showQwertyPasswordTranskeyAction()
return false
}
if textField == confirmPasswordTextfield {
self.showingConfirmPasswordField = true
self.showingPasswordField = false
self.showQwertyPasswordTranskeyAction()
return false
}
return true
}
// MARK: - TablePresenterDelegate
extension RegisterViewController: TablePresenterDelegate {
func TablePresenterView(_ viewController: TablePresenterViewController) -> TablePresenterConfiguration {
return TablePresenterConfiguration(
presenterTitle: "select_country_text".localized(),
closeButtonTitle: "cancel_text".localized(),
notFoundTitle: "no_result_found_text".localized(),
searchBarPlaceHolder: "search_country_text".localized(),
isUseSearchBar: true
)
}
func TablePresenterView(_ viewController: TablePresenterViewController, didSelectModel model: TablePresenterProtocol?) {
selectedNativeCountry = model as? NativeCountryModel
}
}

2
GMERemittance/Module/SendMoneyModules/SendMoneyVerification/User Interface/View/SendMoneyVerificationViewController.swift

@ -317,7 +317,7 @@ extension SendMoneyVerificationViewController: BiometricAuthenticationViewContro
}
extension SendMoneyVerificationViewController: SecureKeypadDelegate {
func didComplete(_ encryptedString: String) {
func didComplete(_ encryptedString: String, length: Int) {
self.password = encryptedString
}
}

2
GMERemittance/Utility/Database/GMEDB.swift

@ -106,8 +106,6 @@ extension GMEDB {
.set(user?.nickName, .nickName)
self.user
// FIXME: FOR TEST
// .set(true, .kyc)
.set(user?.kyc, .kyc)
.set(user?.pennyTestStatus, .pennyTestStatusCode)
.set(user?.verified, .verified)

9
GMERemittance/Utility/SecureKeypad.swift

@ -9,7 +9,7 @@
import Foundation
protocol SecureKeypadDelegate: class {
func didComplete(_ encryptedString: String)
func didComplete(_ encryptedString: String, length: Int)
}
enum SecureKeypadType {
@ -45,6 +45,7 @@ class SecureKeypad: NSObject {
private var keypadType: SecureKeypadType = .ascii
private var encryptedString = ""
private var decryptedLength = 0
init(target: UIViewController, keypadType: SecureKeypadType = .ascii) {
super.init()
@ -180,13 +181,15 @@ extension SecureKeypad: TransKeyViewDelegate {
self.encryptedString = vc.mTK_GetSecureData()
if vc.mTK_GetDataLength() == 0 {
self.decryptedLength = vc.mTK_GetDataLength()
if self.decryptedLength == 0 {
self.encryptedString = ""
}
vc.dismiss(animated: true){
self.delegate?.didComplete(self.encryptedString)
self.delegate?.didComplete(self.encryptedString, length: self.decryptedLength)
}
}
}

16
GMERemittance/Utility/TablePresenter/User Interface/View/Cell/TableCell.swift

@ -14,12 +14,18 @@ class TableCell: UITableViewCell {
@IBOutlet weak var cellTitleLabel: UILabel!
func setModel(_ model: TablePresenterProtocol?) {
if model?.cellImage == nil {
cellImageView.isHidden = true
}
cellImageView.image = model?.cellImage
let cellImage = model?.cellImage
cellImageView.isHidden = cellImage == nil ? true : false
cellImageView.image = cellImage
cellTitleLabel.text = model?.cellTitle
}
func optimizeCell() {
if cellImageView.image == nil {
cellImageView.isHidden = true
} else {
cellImageView.isHidden = false
}
}
}

7
GMERemittance/Utility/TablePresenter/User Interface/View/TablePresenterViewController.swift

@ -147,8 +147,7 @@ extension TablePresenterViewController: UITableViewDataSource {
return cell
}
}
// MARK: - UITableViewDelegate
@ -159,6 +158,10 @@ extension TablePresenterViewController: UITableViewDelegate {
self.dismiss(animated: true)
}
}
// func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) {
// (cell as? TableCell)?.optimizeCell()
// }
}

2
Pods/ValidationTextField/ValidationTextField/Classes/ValidationTextField.swift

@ -383,7 +383,7 @@ open class ValidationTextField: UITextField {
}
private func update(){
if !isValid && isEditing && text != "" {
if !isValid && text != "" {
errorLabel.text = errorMessage
errorLabel.textColor = errorColor
errorLabel.font = errorFont

5
en.lproj/Localizable.strings

@ -519,3 +519,8 @@
"id_number_title_text" = "ID Number (Optional)";
"placeholder_enter_id_type_text" = "Select ID Type";
"placeholder_enter_id_number_text" = "Enter receiver's ID number";
// New Register
"userid_title_text" = "User ID";
"userid_placeholder_text" = "Enter your ID for using GME";
"userid_error_text" = "ID must be at least 6 characters";
Loading…
Cancel
Save