Browse Source

1. added new filter type : uppercaceAlphabet

2. link each documents
3. added api for bank information at step3
4. changed modal presentation style as over full screen
pull/1/head
InKwon James Kim 5 years ago
parent
commit
a5a4ba2835
  1. 8
      GME Remit.xcodeproj/project.pbxproj
  2. 2
      GME Remit/Extensions/UITextField+Ext.swift
  3. 4
      GME Remit/Modules/ManageAgreement/User Interface/Presenter/ManageAgreementPresenter.swift
  4. 34
      GME Remit/Modules/ManageAgreement/User Interface/View/ManageAgreement.storyboard
  5. 21
      GME Remit/Modules/ManageAgreement/User Interface/View/ManageAgreementViewController.swift
  6. 22
      GME Remit/Modules/RegisterModules/UserAuthentication/NewRegisterStep1/Application Logic/Interactor/NewRegisterStep1Interactor.swift
  7. 29
      GME Remit/Modules/RegisterModules/UserAuthentication/NewRegisterStep1/User Interface/View/NewRegisterStep1.storyboard
  8. 83
      GME Remit/Modules/RegisterModules/UserAuthentication/NewRegisterStep1/User Interface/View/NewRegisterStep1ViewController.swift
  9. 147
      GME Remit/Modules/RegisterModules/UserAuthentication/NewRegisterStep2/User Interface/View/NewRegisterStep2.storyboard
  10. 26
      GME Remit/Modules/RegisterModules/UserAuthentication/NewRegisterStep3/Application Logic/Interactor/NewRegisterStep3Interactor.swift
  11. 4
      GME Remit/Modules/RegisterModules/UserAuthentication/NewRegisterStep3/Application Logic/Interactor/NewRegisterStep3InteractorIO.swift
  12. 10
      GME Remit/Modules/RegisterModules/UserAuthentication/NewRegisterStep3/Application Logic/Service/NewRegisterStep3Service.swift
  13. 20
      GME Remit/Modules/RegisterModules/UserAuthentication/NewRegisterStep3/User Interface/Presenter/NewRegisterStep3Presenter.swift
  14. 24
      GME Remit/Modules/RegisterModules/UserAuthentication/NewRegisterStep3/User Interface/View/NewRegisterStep3ViewController.swift
  15. 1
      GME Remit/Utilities/ImageCroper.swift
  16. 3
      GME Remit/Utilities/KeyChain.swift
  17. 6
      GME Remit/Utilities/MultiMediaManager.swift

8
GME Remit.xcodeproj/project.pbxproj

@ -16728,7 +16728,7 @@
CODE_SIGN_ENTITLEMENTS = "GME Remit.entitlements";
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 0;
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 5QB497ZAGT;
ENABLE_BITCODE = NO;
@ -16743,7 +16743,7 @@
"$(inherited)",
"$(PROJECT_DIR)/GME\\ Remit/ThirdParty/virtualKeyboard/mtk_module",
);
MARKETING_VERSION = 2.9.1;
MARKETING_VERSION = 3.0.0;
PRODUCT_BUNDLE_IDENTIFIER = com.gme.gmeremit;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
@ -16763,7 +16763,7 @@
CODE_SIGN_ENTITLEMENTS = "GME Remit.entitlements";
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 0;
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 5QB497ZAGT;
ENABLE_BITCODE = NO;
@ -16779,7 +16779,7 @@
"$(inherited)",
"$(PROJECT_DIR)/GME\\ Remit/ThirdParty/virtualKeyboard/mtk_module",
);
MARKETING_VERSION = 2.9.1;
MARKETING_VERSION = 3.0.0;
PRODUCT_BUNDLE_IDENTIFIER = com.gme.gmeremit;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";

2
GME Remit/Extensions/UITextField+Ext.swift

@ -11,6 +11,7 @@ import RxSwift
import RxCocoa
public enum GMEKeyboardType: String {
case uppercaseAlphabet = "UA"
case alphabet = "A"
case alphabetNumberic = "AN"
case alphabetNumbericSpecial = "ANS"
@ -23,6 +24,7 @@ extension UITextField {
let extractText: String?
switch type {
case .uppercaseAlphabet: extractText = text?.uppercased().extract(regex: "[A-Z\\s]")
case .alphabet: extractText = text?.extract(regex: "[A-Za-z\\s]")
case .alphabetNumberic: extractText = text?.extract(regex: "[A-Z0-9a-z\\s]")
case .alphabetNumbericSpecial: extractText = text?.filter { $0.isASCII }

4
GME Remit/Modules/ManageAgreement/User Interface/Presenter/ManageAgreementPresenter.swift

@ -42,7 +42,8 @@ class ManageAgreementPresenter: ViewModelType {
input.submit.withLatestFrom(input.agreement) {$1}
.asObservable().subscribe(onNext: {[weak self] in
self?.interactor?.agreement($0)
self?.progressLinker.onNext(true)
self?.interactor?.agreement($0)
}).disposed(by: disposeBag)
return Output(
@ -61,6 +62,7 @@ extension ManageAgreementPresenter: ManageAgreementInteractorOutput {
}
func resultAgreement() {
progressLinker.onNext(false)
wireframe?.goNewRegistration()
}

34
GME Remit/Modules/ManageAgreement/User Interface/View/ManageAgreement.storyboard

@ -35,18 +35,18 @@
<rect key="frame" x="0.0" y="0.0" width="414" height="704"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="25" translatesAutoresizingMaskIntoConstraints="NO" id="bIZ-o2-16W">
<rect key="frame" x="20" y="20" width="374" height="189.33333333333334"/>
<rect key="frame" x="20" y="20" width="374" height="215"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="252" text="Please accept the terms and conditions." textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.69999999999999996" translatesAutoresizingMaskIntoConstraints="NO" id="zKP-oe-ean">
<rect key="frame" x="0.0" y="0.0" width="374" height="25.666666666666668"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="252" text="Please accept the terms and conditions." textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" minimumScaleFactor="0.69999999999999996" translatesAutoresizingMaskIntoConstraints="NO" id="zKP-oe-ean">
<rect key="frame" x="0.0" y="0.0" width="374" height="51.333333333333336"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Bold" family="San Francisco Display" pointSize="22"/>
<color key="textColor" name="ThemeText"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="W1Q-CZ-5Ed">
<rect key="frame" x="0.0" y="50.666666666666657" width="374" height="138.66666666666666"/>
<rect key="frame" x="0.0" y="76.333333333333357" width="374" height="138.66666666666663"/>
<color key="tintColor" name="ThemeText"/>
<mutableString key="text">In order to use GME's overseas remittances and domestic remittances smoothly, you need to agree to withdraw money from your account. Withdrawal transfer will be made through open banking from the account you agreed to withdraw when using services such as overseas remittance and domestic remittance.</mutableString>
<string key="text">In order to use GME's overseas remittances and domestic remittances smoothly, you need to agree to withdraw money from your account. Withdrawal transfer will be made through open banking from the account you agreed to withdraw when using services such as overseas remittance and domestic remittance.</string>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="17"/>
<color key="textColor" name="ThemeText"/>
<nil key="highlightedColor"/>
@ -79,7 +79,7 @@
<constraint firstAttribute="trailing" secondItem="BTl-c9-lv6" secondAttribute="trailing" constant="5" id="p6g-9R-1wL"/>
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Personal Information Treatment Policy" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="wHw-tD-Mwe">
<label opaque="NO" userInteractionEnabled="NO" tag="1" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Personal Information Treatment Policy" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="wHw-tD-Mwe">
<rect key="frame" x="43" y="11.333333333333316" width="293" height="17.666666666666671"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="15"/>
<color key="textColor" name="ThemeText"/>
@ -126,7 +126,7 @@
<constraint firstItem="opu-BS-I6h" firstAttribute="top" secondItem="pJc-VR-rn9" secondAttribute="top" constant="5" id="jvQ-qm-2bX"/>
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Personal Information Collection and Usage Agreement" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="PC1-cn-KOb">
<label opaque="NO" userInteractionEnabled="NO" tag="2" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Personal Information Collection and Usage Agreement" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="PC1-cn-KOb">
<rect key="frame" x="43" y="2.6666666666666288" width="293" height="35"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="15"/>
<color key="textColor" name="ThemeText"/>
@ -170,8 +170,8 @@
<constraint firstItem="LDw-i1-qz8" firstAttribute="top" secondItem="0SP-YH-gKf" secondAttribute="top" constant="5" id="zDf-li-gY6"/>
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Agreement of Legal Name Confirmation for Prohibiting Manipulation of the Law and Illegal Behavior" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" minimumScaleFactor="0.80000000000000004" translatesAutoresizingMaskIntoConstraints="NO" id="ar6-Oi-V5q">
<rect key="frame" x="43" y="0.0" width="293" height="40"/>
<label opaque="NO" userInteractionEnabled="NO" tag="3" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Agreement of Legal Name Confirmation for Prohibiting Manipulation of the Law and Illegal Behavior" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" minimumScaleFactor="0.80000000000000004" translatesAutoresizingMaskIntoConstraints="NO" id="ar6-Oi-V5q">
<rect key="frame" x="43" y="2.6666666666666288" width="293" height="35"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="15"/>
<color key="textColor" name="ThemeText"/>
<nil key="highlightedColor"/>
@ -214,8 +214,8 @@
<constraint firstAttribute="bottom" secondItem="aBP-xj-gh8" secondAttribute="bottom" constant="5" id="qsX-oI-PgJ"/>
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Terms of Use for Small Scale Amount Remittance " textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.80000000000000004" translatesAutoresizingMaskIntoConstraints="NO" id="pgj-on-l2H">
<rect key="frame" x="43" y="11.333333333333373" width="293" height="17.666666666666671"/>
<label opaque="NO" userInteractionEnabled="NO" tag="4" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Terms of Use for Small Scale Amount Remittance " textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" minimumScaleFactor="0.80000000000000004" translatesAutoresizingMaskIntoConstraints="NO" id="pgj-on-l2H">
<rect key="frame" x="43" y="2.6666666666666288" width="293" height="35"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="15"/>
<color key="textColor" name="ThemeText"/>
<nil key="highlightedColor"/>
@ -258,7 +258,7 @@
<constraint firstAttribute="bottom" secondItem="e6s-s2-H4P" secondAttribute="bottom" constant="5" id="qNg-1m-dGq"/>
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Terms of Use for Open-Banking Service" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.80000000000000004" translatesAutoresizingMaskIntoConstraints="NO" id="VKq-wY-9dy">
<label opaque="NO" userInteractionEnabled="NO" tag="5" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Terms of Use for Open-Banking Service" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" minimumScaleFactor="0.80000000000000004" translatesAutoresizingMaskIntoConstraints="NO" id="VKq-wY-9dy">
<rect key="frame" x="43" y="11.333333333333373" width="293" height="17.666666666666671"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="15"/>
<color key="textColor" name="ThemeText"/>
@ -302,8 +302,8 @@
<constraint firstItem="lwr-2h-qVb" firstAttribute="leading" secondItem="jlh-Gr-hgV" secondAttribute="leading" constant="5" id="mQp-7W-o5U"/>
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Terms of Use for Electronic Finance Transaction" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.80000000000000004" translatesAutoresizingMaskIntoConstraints="NO" id="uqb-BL-g4N">
<rect key="frame" x="43" y="11.333333333333373" width="293" height="17.666666666666671"/>
<label opaque="NO" userInteractionEnabled="NO" tag="6" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Terms of Use for Electronic Finance Transaction" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" minimumScaleFactor="0.80000000000000004" translatesAutoresizingMaskIntoConstraints="NO" id="uqb-BL-g4N">
<rect key="frame" x="43" y="2.6666666666666288" width="293" height="35"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="15"/>
<color key="textColor" name="ThemeText"/>
<nil key="highlightedColor"/>
@ -380,6 +380,12 @@
<outlet property="checkBox4" destination="aBP-xj-gh8" id="fEr-zm-ibT"/>
<outlet property="checkBox5" destination="e6s-s2-H4P" id="PJl-a9-tvn"/>
<outlet property="checkBox6" destination="lwr-2h-qVb" id="cJz-xm-YaX"/>
<outlet property="documentTitleLabel1" destination="wHw-tD-Mwe" id="bAa-JO-uv9"/>
<outlet property="documentTitleLabel2" destination="PC1-cn-KOb" id="bDU-cH-bl8"/>
<outlet property="documentTitleLabel3" destination="ar6-Oi-V5q" id="dIt-jk-0wt"/>
<outlet property="documentTitleLabel4" destination="pgj-on-l2H" id="bjy-DW-Re6"/>
<outlet property="documentTitleLabel5" destination="VKq-wY-9dy" id="DzY-Xo-q8Y"/>
<outlet property="documentTitleLabel6" destination="uqb-BL-g4N" id="Wh8-Cp-Jwo"/>
<outlet property="infoLabel" destination="W1Q-CZ-5Ed" id="F9q-tQ-JK1"/>
<outlet property="titleLabel" destination="zKP-oe-ean" id="jJx-Vy-s2w"/>
</connections>

21
GME Remit/Modules/ManageAgreement/User Interface/View/ManageAgreementViewController.swift

@ -18,6 +18,7 @@ class ManageAgreementViewController: UIViewController {
private let disposeBag = DisposeBag()
private var isFirst = true
private var documents: [AgreePDFDocument]?
private var titleLabels: [UILabel]?
// MARK: Computed Properties
// MARK: IBOutlets
@ -33,6 +34,13 @@ class ManageAgreementViewController: UIViewController {
@IBOutlet private weak var titleLabel: UILabel!
@IBOutlet private weak var infoLabel: UILabel!
@IBOutlet private weak var documentTitleLabel1: UILabel!
@IBOutlet private weak var documentTitleLabel2: UILabel!
@IBOutlet private weak var documentTitleLabel3: UILabel!
@IBOutlet private weak var documentTitleLabel4: UILabel!
@IBOutlet private weak var documentTitleLabel5: UILabel!
@IBOutlet private weak var documentTitleLabel6: UILabel!
// MARK: VC's Life cycle
override func viewDidLoad() {
super.viewDidLoad()
@ -69,14 +77,17 @@ class ManageAgreementViewController: UIViewController {
@IBAction func touchDetail(_ sender: UIButton) {
guard
let doc = documents?.first(where: {$0.id == "\(sender.tag)"}),
let url = doc.url else {
let url = doc.url,
let titleLabel = titleLabels?.first(where: {$0.tag == sender.tag}),
let title = titleLabel.text
else {
alert(type: .error, message: "PDF URL is wrong.")
return
}
let detailVC = PDFViewController(nibName: "PDFViewController", bundle: nil)
let configure = PDFConfiguration(
title: "금융기관 출금이체 약관",
title: title,
url: url
)
@ -110,6 +121,12 @@ extension ManageAgreementViewController {
navigationItem.leftBarButtonItem = newBackButton
}
titleLabels = [
documentTitleLabel1, documentTitleLabel2, documentTitleLabel3,
documentTitleLabel4, documentTitleLabel5, documentTitleLabel6
]
}
private func setUIBinding() {

22
GME Remit/Modules/RegisterModules/UserAuthentication/NewRegisterStep1/Application Logic/Interactor/NewRegisterStep1Interactor.swift

@ -16,6 +16,8 @@ class NewRegisterStep1Interactor {
private let service: NewRegisterStep1ServiceType
private var saveModel: KYCSave?
private var storedModel: KYCInformation?
// MARK: Initialization
init(service: NewRegisterStep1ServiceType) {
@ -30,6 +32,7 @@ extension NewRegisterStep1Interactor: NewRegisterStep1InteractorInput {
func fetchInformation() {
service.fetchInformation(
success: {[weak self] in
self?.storedModel = $0
self?.output?.setModel(with: $0)
},
failure: {[weak self] in
@ -41,23 +44,14 @@ extension NewRegisterStep1Interactor: NewRegisterStep1InteractorInput {
func saveInformation(with model: KYCSave) {
saveModel = model
if storedModel?.primaryInformation?.bankID != saveModel?.primaryInformation?.bankID ||
storedModel?.primaryInformation?.bankAccount != saveModel?.primaryInformation?.bankAccount {
GMEDB.shared.user.set("0", .pennyTestStatusCode)
}
service.saveInformation(
with: model,
success: {[weak self] in
if let bankCode = model.primaryInformation?.bankID,
let bankAccount = model.primaryInformation?.bankAccount,
let bankName = model.primaryInformation?.bankName {
KeyChain.shared.save(data: bankCode, key: .bankCode)
KeyChain.shared.save(data: bankAccount, key: .bankAccount)
KeyChain.shared.save(data: bankName, key: .bankName)
let storedAccount = KeyChain.shared.get(key: .bankAccount) ?? ""
if storedAccount != bankAccount {
GMEDB.shared.user.set("0", .pennyTestStatusCode)
}
}
self?.output?.setSaveResult(with: self?.saveModel, message: $0)
},
failure: {[weak self] in

29
GME Remit/Modules/RegisterModules/UserAuthentication/NewRegisterStep1/User Interface/View/NewRegisterStep1.storyboard

@ -29,13 +29,13 @@
<rect key="frame" x="0.0" y="0.0" width="375" height="2200"/>
<subviews>
<view contentMode="scaleToFill" placeholderIntrinsicWidth="375" placeholderIntrinsicHeight="594.5" translatesAutoresizingMaskIntoConstraints="NO" id="Eo4-5K-LDm">
<rect key="frame" x="0.0" y="0.0" width="375" height="1922"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="1873"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="CjJ-RL-q3P">
<rect key="frame" x="10" y="10" width="355" height="1902"/>
<rect key="frame" x="10" y="10" width="355" height="1853"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="2uA-JL-3Oz">
<rect key="frame" x="20" y="20" width="315" height="1862"/>
<rect key="frame" x="20" y="20" width="315" height="1813"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="WvQ-u9-oWm">
<rect key="frame" x="0.0" y="0.0" width="315" height="448"/>
@ -224,7 +224,7 @@
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="zZG-kb-0IG">
<rect key="frame" x="0.0" y="453" width="315" height="1409"/>
<rect key="frame" x="0.0" y="453" width="315" height="1360"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="j3E-yb-vrP">
<rect key="frame" x="0.0" y="0.0" width="315" height="957"/>
@ -286,7 +286,7 @@
<rect key="frame" x="0.0" y="53" width="315" height="45"/>
<color key="textColor" name="ThemeText"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
<textInputTraits key="textInputTraits" keyboardType="numberPad"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="isShowTitle" value="NO"/>
<userDefinedRuntimeAttribute type="boolean" keyPath="isUseTitle" value="NO"/>
@ -400,7 +400,7 @@
<constraint firstAttribute="height" constant="25" id="fsg-k2-XcJ"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="252" verticalHuggingPriority="251" text="Another ID (Optional)" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Knm-yY-Ukr">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="252" verticalHuggingPriority="251" text="Another ID (Optional)" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="Knm-yY-Ukr">
<rect key="frame" x="30" y="0.0" width="177.5" height="25"/>
<constraints>
<constraint firstAttribute="height" constant="25" id="WnD-h7-H27"/>
@ -413,6 +413,7 @@
<rect key="frame" x="212.5" y="0.0" width="102.5" height="25"/>
<constraints>
<constraint firstAttribute="height" constant="25" id="08I-N0-npb"/>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="50" id="Ktu-w7-Rxd"/>
</constraints>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Medium" family="San Francisco Display" pointSize="15"/>
<inset key="titleEdgeInsets" minX="10" minY="3" maxX="0.0" maxY="0.0"/>
@ -571,7 +572,7 @@
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="1qD-b2-Vjx">
<rect key="frame" x="0.0" y="962" width="315" height="447"/>
<rect key="frame" x="0.0" y="962" width="315" height="398"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="Z47-9g-KfX">
<rect key="frame" x="0.0" y="0.0" width="315" height="25"/>
@ -710,7 +711,7 @@
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Another ID (Optional)" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="OEE-Gl-1fp">
<rect key="frame" x="0.0" y="0.0" width="140.5" height="35"/>
<constraints>
<constraint firstAttribute="height" constant="35" id="RZl-BX-uz4"/>
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="35" id="RZl-BX-uz4"/>
</constraints>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Medium" family="San Francisco Display" pointSize="15"/>
<color key="textColor" name="ThemeText"/>
@ -772,15 +773,8 @@
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="rQc-Na-RHn">
<rect key="frame" x="0.0" y="353" width="315" height="29"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="14"/>
<state key="normal" title="Terms and Conditions">
<color key="titleColor" name="ThemeBlue"/>
</state>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="7Mi-XW-eEl">
<rect key="frame" x="0.0" y="402" width="315" height="45"/>
<rect key="frame" x="0.0" y="353" width="315" height="45"/>
<color key="backgroundColor" name="ThemeRed"/>
<constraints>
<constraint firstAttribute="height" constant="45" id="E1G-lN-anZ"/>
@ -889,9 +883,6 @@
<image name="ic_passport_picture" width="512" height="512"/>
<image name="id" width="512" height="512"/>
<image name="picture" width="32" height="32"/>
<namedColor name="ThemeBlue">
<color red="0.18823529411764706" green="0.24313725490196078" blue="0.62352941176470589" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="ThemeMainBackground">
<color red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>

83
GME Remit/Modules/RegisterModules/UserAuthentication/NewRegisterStep1/User Interface/View/NewRegisterStep1ViewController.swift

@ -152,6 +152,7 @@ class NewRegisterStep1ViewController: UIViewController {
alertVC.alertView.layer.cornerRadius = 5
let action = PMAlertAction(title: "ok_text".localized(), style: .cancel)
alertVC.addAction(action)
alertVC.modalPresentationStyle = .overFullScreen
self.present(alertVC, animated: true, completion: nil)
}
}
@ -302,13 +303,17 @@ extension NewRegisterStep1ViewController {
.drive(onNext: {[weak self] in
if let imageData = $0 {
if let dataDecoded = Data(base64Encoded: imageData, options: .ignoreUnknownCharacters) {
self?.passportImageButton.setImage(UIImage(data: dataDecoded), for: .normal)
self?.passportImageButton.addBlur()
self?.hideBorder(view: self?.passportImageContainerView)
DispatchQueue.main.async {
self?.passportImageButton.setImage(UIImage(data: dataDecoded), for: .normal)
self?.passportImageButton.addBlur()
self?.hideBorder(view: self?.passportImageContainerView)
}
} else if let url = URL(string: imageData) {
self?.passportImageButton.kf.setImage(with: url, for: .normal)
self?.passportImageButton.addBlur()
self?.hideBorder(view: self?.passportImageContainerView)
DispatchQueue.main.async {
self?.passportImageButton.kf.setImage(with: url, for: .normal)
self?.passportImageButton.addBlur()
self?.hideBorder(view: self?.passportImageContainerView)
}
}
} else {
self?.passportImageButton.setImage(UIImage(named: "ic_passport_picture"), for: .normal)
@ -321,13 +326,17 @@ extension NewRegisterStep1ViewController {
.drive(onNext: {[weak self] in
if let imageData = $0 {
if let dataDecoded = Data(base64Encoded: imageData, options: .ignoreUnknownCharacters) {
self?.anotherIDImageButton.setImage(UIImage(data: dataDecoded), for: .normal)
self?.anotherIDImageButton.addBlur()
self?.hideBorder(view: self?.anotherIDImageContainerView)
DispatchQueue.main.async {
self?.anotherIDImageButton.setImage(UIImage(data: dataDecoded), for: .normal)
self?.anotherIDImageButton.addBlur()
self?.hideBorder(view: self?.anotherIDImageContainerView)
}
} else if let url = URL(string: imageData) {
self?.anotherIDImageButton.kf.setImage(with: url, for: .normal)
self?.anotherIDImageButton.addBlur()
self?.hideBorder(view: self?.anotherIDImageContainerView)
DispatchQueue.main.async {
self?.anotherIDImageButton.kf.setImage(with: url, for: .normal)
self?.anotherIDImageButton.addBlur()
self?.hideBorder(view: self?.anotherIDImageContainerView)
}
}
} else {
self?.anotherIDImageButton.setImage(UIImage(named: "ic_another_id_picture"), for: .normal)
@ -335,21 +344,21 @@ extension NewRegisterStep1ViewController {
}).disposed(by: disposeBag)
anotherIDClearButton.rx.tap.asDriver()
.drive(onNext: {[weak self] in
self?.idTypeTextField.didSelect(item: nil)
self?.idNumberTextField.text = ""
self?.idNumberTextField.sendActions(for: .editingChanged)
self?.idIssueDateTextField.text = ""
self?.idIssueDateTextField.sendActions(for: .editingChanged)
self?.idExpiryDateTextField.text = ""
self?.idExpiryDateTextField.sendActions(for: .editingChanged)
self?.anotherIDImageTrigger.onNext(nil)
}).disposed(by: disposeBag)
.drive(onNext: {[weak self] in
self?.idTypeTextField.didSelect(item: nil)
self?.idNumberTextField.text = ""
self?.idNumberTextField.sendActions(for: .editingChanged)
self?.idIssueDateTextField.text = ""
self?.idIssueDateTextField.sendActions(for: .editingChanged)
self?.idExpiryDateTextField.text = ""
self?.idExpiryDateTextField.sendActions(for: .editingChanged)
self?.anotherIDImageTrigger.onNext(nil)
}).disposed(by: disposeBag)
userNameTextField.rx.filterBy(.alphabet).disposed(by: disposeBag)
userNameTextField.rx.filterBy(.uppercaseAlphabet).disposed(by: disposeBag)
emailTextField.rx.filterBy(.alphabetNumbericSpecial).disposed(by: disposeBag)
addressTextField.rx.filterBy(.alphabetNumberic).disposed(by: disposeBag)
bankAccountTextField.rx.filterBy(.numberic).disposed(by: disposeBag)
@ -590,22 +599,28 @@ extension NewRegisterStep1ViewController {
isValidPersonalInfo
.distinctUntilChanged()
.asDriverOnErrorJustComplete().drive(onNext: {[weak self] isEnable in
self?.personalSaveButton.isEnabled = isEnable
self?.personalSaveButton.backgroundColor = isEnable ? .themeRed : .lightGray
}).disposed(by: disposeBag)
DispatchQueue.main.async {
self?.personalSaveButton.isEnabled = isEnable
self?.personalSaveButton.backgroundColor = isEnable ? .themeRed : .lightGray
}
}).disposed(by: disposeBag)
isValidPrimaryInfo
.distinctUntilChanged()
.asDriverOnErrorJustComplete().drive(onNext: {[weak self] isEnable in
self?.bankSaveButton.isEnabled = isEnable
self?.bankSaveButton.backgroundColor = isEnable ? .themeRed : .lightGray
}).disposed(by: disposeBag)
DispatchQueue.main.async {
self?.bankSaveButton.isEnabled = isEnable
self?.bankSaveButton.backgroundColor = isEnable ? .themeRed : .lightGray
}
}).disposed(by: disposeBag)
isValidPictures
.distinctUntilChanged()
.asDriverOnErrorJustComplete().drive(onNext: {[weak self] isEnable in
self?.picturesSaveButton.isEnabled = isEnable
self?.picturesSaveButton.backgroundColor = isEnable ? .themeRed : .lightGray
DispatchQueue.main.async {
self?.picturesSaveButton.isEnabled = isEnable
self?.picturesSaveButton.backgroundColor = isEnable ? .themeRed : .lightGray
}
}).disposed(by: disposeBag)
}

147
GME Remit/Modules/RegisterModules/UserAuthentication/NewRegisterStep2/User Interface/View/NewRegisterStep2.storyboard

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15702" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="HSb-ou-7T5">
<device id="retina6_5" orientation="portrait" appearance="light"/>
<device id="retina4_0" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/>
@ -19,89 +19,96 @@
<objects>
<viewController storyboardIdentifier="NewRegisterStep2ViewController" title="NewRegisterStep2" id="HSb-ou-7T5" customClass="NewRegisterStep2ViewController" customModule="GME_Remit" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="9Uc-9s-KgO">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Gv7-tx-oNi">
<rect key="frame" x="0.0" y="44" width="414" height="818"/>
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="lxo-UN-CJe">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="30" translatesAutoresizingMaskIntoConstraints="NO" id="z64-2n-bWJ">
<rect key="frame" x="20" y="20" width="374" height="680"/>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Gv7-tx-oNi">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="WqX-aD-QAZ">
<rect key="frame" x="0.0" y="0.0" width="374" height="400.66666666666669"/>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="30" translatesAutoresizingMaskIntoConstraints="NO" id="z64-2n-bWJ">
<rect key="frame" x="20" y="20" width="280" height="348.5"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="ic_mobile_with_arc" translatesAutoresizingMaskIntoConstraints="NO" id="7lH-1R-zSW">
<rect key="frame" x="0.0" y="0.0" width="374" height="400.66666666666669"/>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="WqX-aD-QAZ">
<rect key="frame" x="0.0" y="0.0" width="280" height="252"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="ic_mobile_with_arc" translatesAutoresizingMaskIntoConstraints="NO" id="7lH-1R-zSW">
<rect key="frame" x="0.0" y="0.0" width="280" height="252"/>
<constraints>
<constraint firstAttribute="width" secondItem="7lH-1R-zSW" secondAttribute="height" multiplier="1:0.9" id="p6O-mG-p12"/>
</constraints>
</imageView>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="width" secondItem="7lH-1R-zSW" secondAttribute="height" multiplier="14:15" id="p6O-mG-p12"/>
<constraint firstAttribute="bottom" secondItem="7lH-1R-zSW" secondAttribute="bottom" id="03D-jj-EMy"/>
<constraint firstAttribute="trailing" secondItem="7lH-1R-zSW" secondAttribute="trailing" id="Dah-7o-MbM"/>
<constraint firstItem="7lH-1R-zSW" firstAttribute="top" secondItem="WqX-aD-QAZ" secondAttribute="top" id="ewR-na-oBq"/>
<constraint firstItem="7lH-1R-zSW" firstAttribute="leading" secondItem="WqX-aD-QAZ" secondAttribute="leading" id="rWd-oQ-ojH"/>
</constraints>
</imageView>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="253" verticalHuggingPriority="254" text="Do you have a phone number registered with Alien Registration Card under your name?" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" minimumScaleFactor="0.69999999999999996" translatesAutoresizingMaskIntoConstraints="NO" id="Eg4-JX-YyB">
<rect key="frame" x="0.0" y="282" width="280" height="66.5"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Medium" family="San Francisco Display" pointSize="19"/>
<color key="textColor" name="ThemeText"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="7lH-1R-zSW" secondAttribute="bottom" id="03D-jj-EMy"/>
<constraint firstAttribute="trailing" secondItem="7lH-1R-zSW" secondAttribute="trailing" id="Dah-7o-MbM"/>
<constraint firstItem="7lH-1R-zSW" firstAttribute="top" secondItem="WqX-aD-QAZ" secondAttribute="top" id="ewR-na-oBq"/>
<constraint firstItem="7lH-1R-zSW" firstAttribute="leading" secondItem="WqX-aD-QAZ" secondAttribute="leading" id="rWd-oQ-ojH"/>
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="253" verticalHuggingPriority="254" text="Do you have a phone number registered with Alien Registration Card under your name?" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" minimumScaleFactor="0.69999999999999996" translatesAutoresizingMaskIntoConstraints="NO" id="Eg4-JX-YyB">
<rect key="frame" x="0.0" y="430.66666666666669" width="374" height="66.666666666666686"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Medium" family="San Francisco Display" pointSize="19"/>
<color key="textColor" name="ThemeText"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" text="" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Rld-Ke-qAw">
<rect key="frame" x="0.0" y="527.33333333333337" width="374" height="152.66666666666663"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Medium" family="San Francisco Display" pointSize="19"/>
<color key="textColor" name="ThemeText"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="3jy-Ts-86z">
<rect key="frame" x="10" y="710" width="394" height="108"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" verticalHuggingPriority="251" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="m6E-gE-jCo">
<rect key="frame" x="0.0" y="0.0" width="394" height="50"/>
<color key="backgroundColor" name="ThemeRed"/>
<constraints>
<constraint firstAttribute="height" constant="50" id="PyZ-Vh-GAJ"/>
</constraints>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Medium" family="San Francisco Display" pointSize="17"/>
<state key="normal" title="Yes">
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</state>
</button>
<button opaque="NO" contentMode="scaleToFill" verticalHuggingPriority="251" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="nNm-Ke-eRh">
<rect key="frame" x="0.0" y="58" width="394" height="50"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Medium" family="San Francisco Display" pointSize="17"/>
<state key="normal" title="No">
<color key="titleColor" name="ThemeRed"/>
</state>
</button>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="3jy-Ts-86z">
<rect key="frame" x="10" y="450" width="300" height="108"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" verticalHuggingPriority="251" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="m6E-gE-jCo">
<rect key="frame" x="0.0" y="0.0" width="300" height="50"/>
<color key="backgroundColor" name="ThemeRed"/>
<constraints>
<constraint firstAttribute="height" constant="50" id="PyZ-Vh-GAJ"/>
</constraints>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Medium" family="San Francisco Display" pointSize="17"/>
<state key="normal" title="Yes">
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</state>
</button>
<button opaque="NO" contentMode="scaleToFill" verticalHuggingPriority="251" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="nNm-Ke-eRh">
<rect key="frame" x="0.0" y="58" width="300" height="50"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Medium" family="San Francisco Display" pointSize="17"/>
<state key="normal" title="No">
<color key="titleColor" name="ThemeRed"/>
</state>
</button>
</subviews>
</stackView>
</subviews>
</stackView>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="3jy-Ts-86z" firstAttribute="leading" secondItem="Gv7-tx-oNi" secondAttribute="leading" constant="10" id="RtO-gc-1ud"/>
<constraint firstItem="z64-2n-bWJ" firstAttribute="top" secondItem="Gv7-tx-oNi" secondAttribute="top" constant="20" id="gVe-Hf-c38"/>
<constraint firstAttribute="trailing" secondItem="3jy-Ts-86z" secondAttribute="trailing" constant="10" id="gzp-dJ-PJg"/>
<constraint firstAttribute="bottom" secondItem="3jy-Ts-86z" secondAttribute="bottom" constant="10" id="h0F-si-gMV"/>
<constraint firstAttribute="trailing" secondItem="z64-2n-bWJ" secondAttribute="trailing" constant="20" id="lnX-US-OjB"/>
<constraint firstItem="3jy-Ts-86z" firstAttribute="top" relation="greaterThanOrEqual" secondItem="z64-2n-bWJ" secondAttribute="bottom" constant="30" id="owi-qq-K2E"/>
<constraint firstItem="z64-2n-bWJ" firstAttribute="leading" secondItem="Gv7-tx-oNi" secondAttribute="leading" constant="20" id="x3a-uN-eMb"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="3jy-Ts-86z" firstAttribute="leading" secondItem="Gv7-tx-oNi" secondAttribute="leading" constant="10" id="RtO-gc-1ud"/>
<constraint firstItem="z64-2n-bWJ" firstAttribute="top" secondItem="Gv7-tx-oNi" secondAttribute="top" constant="20" id="gVe-Hf-c38"/>
<constraint firstAttribute="trailing" secondItem="3jy-Ts-86z" secondAttribute="trailing" constant="10" id="gzp-dJ-PJg"/>
<constraint firstAttribute="bottom" secondItem="3jy-Ts-86z" secondAttribute="bottom" id="h0F-si-gMV"/>
<constraint firstAttribute="trailing" secondItem="z64-2n-bWJ" secondAttribute="trailing" constant="20" id="lnX-US-OjB"/>
<constraint firstItem="3jy-Ts-86z" firstAttribute="top" secondItem="z64-2n-bWJ" secondAttribute="bottom" constant="10" id="owi-qq-K2E"/>
<constraint firstItem="z64-2n-bWJ" firstAttribute="leading" secondItem="Gv7-tx-oNi" secondAttribute="leading" constant="20" id="x3a-uN-eMb"/>
<constraint firstItem="Gv7-tx-oNi" firstAttribute="width" secondItem="lxo-UN-CJe" secondAttribute="width" id="QRp-FW-0xy"/>
<constraint firstAttribute="bottom" secondItem="Gv7-tx-oNi" secondAttribute="bottom" id="YwG-pg-Ixf"/>
<constraint firstItem="Gv7-tx-oNi" firstAttribute="top" secondItem="lxo-UN-CJe" secondAttribute="top" id="Zyq-Fv-wBD"/>
<constraint firstAttribute="trailing" secondItem="Gv7-tx-oNi" secondAttribute="trailing" id="b1j-0s-ceX"/>
<constraint firstItem="Gv7-tx-oNi" firstAttribute="height" secondItem="lxo-UN-CJe" secondAttribute="height" priority="250" id="gbz-UY-C9c"/>
<constraint firstItem="Gv7-tx-oNi" firstAttribute="leading" secondItem="lxo-UN-CJe" secondAttribute="leading" id="n3c-sg-TDd"/>
</constraints>
</view>
</scrollView>
</subviews>
<color key="backgroundColor" name="ThemeMainBackground"/>
<constraints>
<constraint firstItem="O1T-1R-Sun" firstAttribute="trailing" secondItem="Gv7-tx-oNi" secondAttribute="trailing" id="GB2-ZV-x7s"/>
<constraint firstItem="O1T-1R-Sun" firstAttribute="bottom" secondItem="Gv7-tx-oNi" secondAttribute="bottom" id="NOp-4g-nzd"/>
<constraint firstItem="Gv7-tx-oNi" firstAttribute="leading" secondItem="O1T-1R-Sun" secondAttribute="leading" id="nkR-hb-7jT"/>
<constraint firstItem="Gv7-tx-oNi" firstAttribute="top" secondItem="O1T-1R-Sun" secondAttribute="top" id="v2e-C6-HOA"/>
<constraint firstItem="lxo-UN-CJe" firstAttribute="leading" secondItem="O1T-1R-Sun" secondAttribute="leading" id="3BE-Ai-GA0"/>
<constraint firstItem="lxo-UN-CJe" firstAttribute="trailing" secondItem="O1T-1R-Sun" secondAttribute="trailing" id="Z7u-b8-oiV"/>
<constraint firstItem="lxo-UN-CJe" firstAttribute="top" secondItem="O1T-1R-Sun" secondAttribute="top" id="e9j-xp-5KN"/>
<constraint firstItem="O1T-1R-Sun" firstAttribute="bottom" secondItem="lxo-UN-CJe" secondAttribute="bottom" id="iFU-tB-PPY"/>
</constraints>
<viewLayoutGuide key="safeArea" id="O1T-1R-Sun"/>
</view>
@ -112,7 +119,7 @@
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="8je-5K-XuW" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-91.875" y="232.3943661971831"/>
<point key="canvasLocation" x="-92.753623188405811" y="232.36607142857142"/>
</scene>
</scenes>
<resources>

26
GME Remit/Modules/RegisterModules/UserAuthentication/NewRegisterStep3/Application Logic/Interactor/NewRegisterStep3Interactor.swift

@ -26,6 +26,29 @@ class NewRegisterStep3Interactor {
// MARK: NewRegisterStep3 interactor input interface
extension NewRegisterStep3Interactor: NewRegisterStep3InteractorInput {
func fetchStoredBankInfo() {
let step1Service = NewRegisterStep1Service()
step1Service.fetchInformation(
success: {[weak self] model in
guard
let bank = model.banks?.first(where: {$0.id == model.primaryInformation?.bankID}),
let account = model.primaryInformation?.bankAccount else {
let error = NSError(
domain: "Bank Error",
code: 0,
message: "Your stored bank information wrong. Please check step1"
)
self?.output?.setError(with: error)
return
}
self?.output?.setStoredBankInfo(bank: bank, account: account)
},
failure: {[weak self] in self?.output?.setError(with: $0)}
)
}
func retryRequestPennyTest() {
let pennyTestService = NewRegisterService()
@ -40,8 +63,7 @@ extension NewRegisterStep3Interactor: NewRegisterStep3InteractorInput {
)
}
func submitPennyTest(certNumber: String) {
let account = KeyChain.shared.get(key: .bankAccount) ?? ""
func submitPennyTest(certNumber: String, account: String) {
service.pennyTestSubmitAtRegister(
accountNumber: account,
certNumber: certNumber,

4
GME Remit/Modules/RegisterModules/UserAuthentication/NewRegisterStep3/Application Logic/Interactor/NewRegisterStep3InteractorIO.swift

@ -7,11 +7,13 @@
//
protocol NewRegisterStep3InteractorInput: class {
func fetchStoredBankInfo()
func retryRequestPennyTest()
func submitPennyTest(certNumber: String)
func submitPennyTest(certNumber: String, account: String)
}
protocol NewRegisterStep3InteractorOutput: class {
func setStoredBankInfo(bank: KJBank, account: String)
func resultRequestPennyTest(with message: SuccessMessage)
func setError(with error: Error)

10
GME Remit/Modules/RegisterModules/UserAuthentication/NewRegisterStep3/Application Logic/Service/NewRegisterStep3Service.swift

@ -19,15 +19,5 @@ class NewRegisterStep3Service: NewRegisterStep3ServiceType {
accountNumber: account,
certNumber: number
).json(success: success, failure: failure)
// FIXME: Test
// let message = SuccessMessage()
// FIXME: -success
// success(message)
// FIXME: -failrue
// failure(NSError(domain: "error", code: 0, message: "ERROR!"))
}
}

20
GME Remit/Modules/RegisterModules/UserAuthentication/NewRegisterStep3/User Interface/Presenter/NewRegisterStep3Presenter.swift

@ -14,6 +14,7 @@ class NewRegisterStep3Presenter: ViewModelType {
var wireframe: NewRegisterStep3WireframeInput?
struct Input {
let viewWillAppear: Observable<Void>
let resendTrigger: Observable<Void>
let certNumber: Observable<String>
let submitTrigger: Observable<Void>
@ -22,6 +23,7 @@ class NewRegisterStep3Presenter: ViewModelType {
struct Output {
let isError: Driver<Error>
let isProgress: Driver<Bool>
let storedBankInfo: Driver<(KJBank, String)>
let resendMessage: Driver<String>
let submitMessage: Driver<String>
}
@ -32,22 +34,31 @@ class NewRegisterStep3Presenter: ViewModelType {
private let errorLinker = PublishSubject<Error>()
private let resendMessageLinker = PublishSubject<String>()
private let submitMessageLinker = PublishSubject<String>()
private let storedBankInfo = PublishSubject<(KJBank, String)>()
func transform(input: Input) -> Output {
input.viewWillAppear.subscribe(onNext: {[weak self] in
self?.progressLinker.onNext(true)
self?.interactor?.fetchStoredBankInfo()
}).disposed(by: disposeBag)
input.resendTrigger.subscribe(onNext: {[weak self] in
self?.progressLinker.onNext(true)
self?.interactor?.retryRequestPennyTest()
}).disposed(by: disposeBag)
input.submitTrigger.withLatestFrom(input.certNumber) { $1 }
input.submitTrigger
.withLatestFrom(input.certNumber) { $1 }
.withLatestFrom(storedBankInfo) {($0, $1.1)}
.subscribe(onNext: {[weak self] in
self?.progressLinker.onNext(true)
self?.interactor?.submitPennyTest(certNumber: $0)
self?.interactor?.submitPennyTest(certNumber: $0.0, account: $0.1)
}).disposed(by: disposeBag)
return Output(
isError: errorLinker.asDriverOnErrorJustComplete(),
isProgress: progressLinker.asDriverOnErrorJustComplete(),
storedBankInfo: storedBankInfo.asDriverOnErrorJustComplete(),
resendMessage: resendMessageLinker.asDriverOnErrorJustComplete(),
submitMessage: submitMessageLinker.asDriverOnErrorJustComplete()
)
@ -56,6 +67,11 @@ class NewRegisterStep3Presenter: ViewModelType {
// MARK: NewRegisterStep3 interactor output interface
extension NewRegisterStep3Presenter: NewRegisterStep3InteractorOutput {
func setStoredBankInfo(bank: KJBank, account: String) {
progressLinker.onNext(false)
storedBankInfo.onNext((bank, account))
}
func resultRequestPennyTest(with message: SuccessMessage) {
progressLinker.onNext(false)
resendMessageLinker.onNext(message.message ?? "")

24
GME Remit/Modules/RegisterModules/UserAuthentication/NewRegisterStep3/User Interface/View/NewRegisterStep3ViewController.swift

@ -41,19 +41,14 @@ class NewRegisterStep3ViewController: UIViewController {
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
guard
let bankName = KeyChain.shared.get(key: .bankName),
let bankCode = KeyChain.shared.get(key: .bankCode),
let bankAccount = KeyChain.shared.get(key: .bankAccount) else { return }
bankAccountLabel.text = bankAccount
bankImageView.image = BankEnum.getBankCIFromKJBank(kjBankCode: bankCode)
bankNameLabel.text = bankName
}
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
codeTextField.becomeFirstResponder()
if !codeTextField.becomeFirstResponder() {
codeTextField.becomeFirstResponder()
}
}
override func viewWillDisappear(_ animated: Bool) {
@ -111,7 +106,10 @@ extension NewRegisterStep3ViewController {
}
private func setBinding() {
let viewWillAppear = rx.sentMessage(#selector(UIViewController.viewWillAppear(_:))).mapToVoid()
let input = NewRegisterStep3Presenter.Input(
viewWillAppear: viewWillAppear,
resendTrigger: resendButton.rx.tap.mapToVoid(),
certNumber: codeTextField.rx.text.orEmpty.asObservable(),
submitTrigger: submitButton.rx.tap.mapToVoid()
@ -136,6 +134,14 @@ extension NewRegisterStep3ViewController {
guard let `self` = self else {return}
self.delegate?.newRegister(self, currentStep: .third, nextStep: .finish)
}).disposed(by: disposeBag)
output.storedBankInfo.map {$0.1}.drive(bankAccountLabel.rx.text).disposed(by: disposeBag)
output.storedBankInfo.map {$0.0}.drive(onNext: {[weak self] in
guard let id = $0.id, let name = $0.value else { return }
self?.bankImageView.image = BankEnum.getBankCIFromKJBank(kjBankCode: id)
self?.bankNameLabel.text = name
}).disposed(by: disposeBag)
}
private func showSample() {

1
GME Remit/Utilities/ImageCroper.swift

@ -36,6 +36,7 @@ class ImageCroper: NSObject {
imageCropper.chooseButton.setTitle("done_text".localized(), for: .normal)
self.imageCropper.delegate = self
self.imageCropper.dataSource = self
self.imageCropper.modalPresentationStyle = .overFullScreen
self.presentingViewController?.present(imageCropper, animated: true, completion: nil)
}
}

3
GME Remit/Utilities/KeyChain.swift

@ -18,9 +18,6 @@ final class KeyChain {
case login
case temporaryID
case temporaryPW
case bankCode
case bankAccount
case bankName
}
static let shared = KeyChain()

6
GME Remit/Utilities/MultiMediaManager.swift

@ -63,6 +63,9 @@ class MultiMediaManager: NSObject {
alertController.addAction(cameraAction)
alertController.addAction(galleryAction)
alertController.addAction(cancelAction)
alertController.modalPresentationStyle = .overFullScreen
self.presentViewController(viewController: alertController, animated: true, completion: nil)
}
@ -83,6 +86,8 @@ class MultiMediaManager: NSObject {
self.imagePicker.mediaTypes = mediaTypes
self.imagePicker.cameraCaptureMode = mode
self.imagePicker.allowsEditing = false
self.imagePicker.modalPresentationStyle = .overFullScreen
self.presentViewController(viewController: self.imagePicker, animated: true, completion: nil)
}
@ -105,6 +110,7 @@ class MultiMediaManager: NSObject {
self.imagePicker.sourceType = UIImagePickerController.SourceType.photoLibrary
let mediaTypes = mode == .video ? ["public.image", "public.movie"] : ["public.image"]
self.imagePicker.mediaTypes = mediaTypes
self.imagePicker.modalPresentationStyle = .overFullScreen
self.presentViewController(viewController: self.imagePicker, animated: true, completion: nil)
} else {
self.presenter?.presenting().alert(

Loading…
Cancel
Save