Browse Source

add delegate at WebView

pull/1/head
InKwon James Kim 5 years ago
parent
commit
12008d346f
  1. 3
      GME Remit/Modules/Home/User Interface/View/HomeViewController.swift
  2. 11
      GME Remit/Modules/ManageAccountsModules/AutoDebitModules/AddAccount/User Interface/View/AddAccountViewController.swift
  3. 9
      GME Remit/Modules/ManageAccountsModules/AutoDebitModules/AddAccount/User Interface/Wireframe/AddAccountWireframe.swift
  4. 2
      GME Remit/Modules/ManageAccountsModules/AutoDebitModules/AutoDebit/User Interface/Wireframe/AutoDebitWireframe.swift
  5. 2
      GME Remit/Modules/ManageAccountsModules/TotalManageAccounts/User Interface/Wireframe/TotalManageAccountsWireframe.swift
  6. 1366
      GME Remit/Modules/RegisterModules/UserAuthentication/NewRegisterStep1/Application Logic/Service/NewRegisterStep1Service.swift
  7. 10
      GME Remit/Modules/RegisterModules/UserAuthentication/NewRegisterStep1/User Interface/View/NewRegisterStep1ViewController.swift
  8. 15
      GME Remit/Modules/RegisterModules/UserAuthentication/NewRegisterStep2/Application Logic/Service/NewRegisterStep2Service.swift
  9. 2
      GME Remit/Modules/RegisterModules/UserAuthentication/NewRegisterStep2/User Interface/Wireframe/NewRegisterStep2Wireframe.swift
  10. 14
      GME Remit/Modules/SideMenu/SideMenu.storyboard
  11. 30
      GME Remit/Utilities/WebLinks/WkWebView/WkWebViewController.swift
  12. 23
      Pods/ChannelIO/ChannelIO/Assets/Images.xcassets/clip.imageset/Contents 2.json
  13. 23
      Pods/ChannelIO/ChannelIO/Assets/Images.xcassets/clip.imageset/Contents 3.json
  14. BIN
      Pods/ChannelIO/ChannelIO/Assets/Images.xcassets/clip.imageset/clip 2.png
  15. BIN
      Pods/ChannelIO/ChannelIO/Assets/Images.xcassets/clip.imageset/clip@2x 2.png
  16. BIN
      Pods/ChannelIO/ChannelIO/Assets/Images.xcassets/clip.imageset/clip@3x 2.png
  17. 23
      Pods/ChannelIO/ChannelIO/Assets/Images.xcassets/exitPopup.imageset/Contents 2.json
  18. 23
      Pods/ChannelIO/ChannelIO/Assets/Images.xcassets/exitPopup.imageset/Contents 3.json
  19. BIN
      Pods/ChannelIO/ChannelIO/Assets/Images.xcassets/exitPopup.imageset/exitPopup 2.png
  20. BIN
      Pods/ChannelIO/ChannelIO/Assets/Images.xcassets/exitPopup.imageset/exitPopup@2x 2.png
  21. BIN
      Pods/ChannelIO/ChannelIO/Assets/Images.xcassets/exitPopup.imageset/exitPopup@3x 2.png
  22. 23
      Pods/ChannelIO/ChannelIO/Assets/Images.xcassets/exitSmall.imageset/Contents 2.json
  23. 23
      Pods/ChannelIO/ChannelIO/Assets/Images.xcassets/exitSmall.imageset/Contents 3.json
  24. BIN
      Pods/ChannelIO/ChannelIO/Assets/Images.xcassets/exitSmall.imageset/exitSmall 2.png
  25. BIN
      Pods/ChannelIO/ChannelIO/Assets/Images.xcassets/exitSmall.imageset/exitSmall@2x 2.png
  26. BIN
      Pods/ChannelIO/ChannelIO/Assets/Images.xcassets/exitSmall.imageset/exitSmall@3x 2.png

3
GME Remit/Modules/Home/User Interface/View/HomeViewController.swift

@ -103,6 +103,9 @@ class HomeViewController: UIViewController {
destination = nil
}
// FIXME: Test
self.presenter?.showKyc(step: .first)
}
}
var sections: [Sections] = [.balance, .collection]

11
GME Remit/Modules/ManageAccountsModules/AutoDebitModules/AddAccount/User Interface/View/AddAccountViewController.swift

@ -15,7 +15,7 @@ class AddAccountViewController: UIViewController {
// MARK: Properties
var presenter: AddAccountModuleInterface?
var isKYC = false
weak var delegate: NewRegisterDelegate?
private var selectedLanguage: KftcLanguage?
private var selectedBank: BankInformation?
@ -49,14 +49,19 @@ class AddAccountViewController: UIViewController {
let languageConfigure = TablePresenterConfiguration(presenterTitle: "Select Language")
languageTextField.useAsDropDown(with: languageConfigure, items: model.kftcModel?.languages)
if isKYC {
if delegate != nil {
let bankCode = model.kftcModel?.header?.first {$0.key == "Kftc-Bfop-BankCodeStd"}?.value
let bank = model.bankList?.first { $0.bankCode == bankCode }
selectedBank = bank
guard selectedBank != nil else {
alert(type: .error, message: "The bank you entered cannot be used. For the detail, please call us.\n(You can use another bank)")
let message =
"""
The bank you entered cannot be used. For the detail, please call us.
(You can use another bank)
"""
alert(type: .error, message: message)
return
}

9
GME Remit/Modules/ManageAccountsModules/AutoDebitModules/AddAccount/User Interface/Wireframe/AddAccountWireframe.swift

@ -11,7 +11,7 @@ import UIKit
class AddAccountWireframe {
weak var view: UIViewController!
private var model: KFTCModel?
private var isKYC = false
weak var delegate: NewRegisterDelegate?
}
extension AddAccountWireframe: AddAccountWireframeInput {
@ -25,7 +25,7 @@ extension AddAccountWireframe: AddAccountWireframeInput {
let viewController = viewControllerFromStoryboard(of: AddAccountViewController.self)
viewController.presenter = presenter
viewController.isKYC = isKYC
viewController.delegate = delegate
interactor.output = presenter
presenter.interactor = interactor
presenter.wireframe = self
@ -35,9 +35,9 @@ extension AddAccountWireframe: AddAccountWireframeInput {
return viewController
}
func openPushMainView(with model: KFTCModel?, isKYC: Bool = false, source: UIViewController) {
func openPushMainView(with model: KFTCModel?, delegate: NewRegisterDelegate?, source: UIViewController) {
self.model = model
self.isKYC = isKYC
self.delegate = delegate
let nav = UINavigationController(rootViewController: getMainView())
source.present(nav, animated: true, completion: nil)
@ -51,6 +51,7 @@ extension AddAccountWireframe: AddAccountWireframeInput {
viewcontroller.url = url
viewcontroller.headers = header
viewcontroller.delegate = delegate
view.navigationController?.pushViewController(viewcontroller, animated: true)
}

2
GME Remit/Modules/ManageAccountsModules/AutoDebitModules/AutoDebit/User Interface/Wireframe/AutoDebitWireframe.swift

@ -33,7 +33,7 @@ extension AutoDebitWireframe: AutoDebitWireframeInput {
}
func goAddAccountViewController(with model: KFTCModel?) {
AddAccountWireframe().openPushMainView(with: model, source: view)
AddAccountWireframe().openPushMainView(with: model, delegate: nil, source: view)
}
func goRefreshToken(header: [KftcHeader]?, url: String?) {

2
GME Remit/Modules/ManageAccountsModules/TotalManageAccounts/User Interface/Wireframe/TotalManageAccountsWireframe.swift

@ -31,7 +31,7 @@ extension TotalManageAccountsWireframe: TotalManageAccountsWireframeInput {
}
func openAddAutodebit(with model: KFTCModel?) {
AddAccountWireframe().openPushMainView(with: model, source: view)
AddAccountWireframe().openPushMainView(with: model, delegate: nil, source: view)
}
func openAddInbound(with model: PenneyTestRequest?, delegate: InboundPennyTestSubmitDelegate?) {

1366
GME Remit/Modules/RegisterModules/UserAuthentication/NewRegisterStep1/Application Logic/Service/NewRegisterStep1Service.swift
File diff suppressed because it is too large
View File

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

@ -234,13 +234,13 @@ extension NewRegisterStep1ViewController {
userNameTextField.errorMessage = "kyc_first_name_error".localized()
emailTextField.errorMessage = "".localized()
emailTextField.errorMessage = "Invalid email address".localized()
addressTextField.errorMessage = "The address cannot exceed 50 characters.".localized()
bankAccountTextField.errorMessage = "invalid_account_error_text".localized()
bankTextField.errorMessage = "invalid_account_error_text".localized()
passportNumberTextField.errorMessage = "Invalid possport number".localized()
passportNumberTextField.errorMessage = "".localized()
idNumberTextField.errorMessage = "".localized()
idNumberTextField.errorMessage = "Invalid ID number".localized()
idNumberTextField.delegate = self
setDatePicker(textField: dobTextField, useMaximum: true)

15
GME Remit/Modules/RegisterModules/UserAuthentication/NewRegisterStep2/Application Logic/Service/NewRegisterStep2Service.swift

@ -124,7 +124,20 @@ class NewRegisterStep2Service: NewRegisterStep2ServiceType {
failure(error)
return
}
success(json)
success(json)
// let autodebitService = AutoDebitService()
//
// autodebitService.fetchAccountList(
// username: GMEDB.shared.user.string(.userId) ?? "",
// success: {
// guard let model = $0 else {
// return
// }
// success(model)
// },
// failure: failure
// )
}
}

2
GME Remit/Modules/RegisterModules/UserAuthentication/NewRegisterStep2/User Interface/Wireframe/NewRegisterStep2Wireframe.swift

@ -46,6 +46,6 @@ extension NewRegisterStep2Wireframe: NewRegisterStep2WireframeInput {
}
func goAutodebit(with model: KFTCModel) {
AddAccountWireframe().openPushMainView(with: model, isKYC: true, source: view)
AddAccountWireframe().openPushMainView(with: model, delegate: delegate, source: view)
}
}

14
GME Remit/Modules/SideMenu/SideMenu.storyboard

@ -68,7 +68,7 @@
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="....." textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="7" translatesAutoresizingMaskIntoConstraints="NO" id="SdX-nR-jpH">
<rect key="frame" x="0.0" y="86" width="20.5" height="17"/>
<rect key="frame" x="0.0" y="86" width="19.5" height="17"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="17" id="dRD-RB-xrC"/>
@ -142,13 +142,13 @@
<rect key="frame" x="0.0" y="0.0" width="15" height="45"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" " textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0va-Ca-iYx">
<rect key="frame" x="0.0" y="0.0" width="15" height="14.5"/>
<rect key="frame" x="0.0" y="0.0" width="15" height="10.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="sm_managet_accounts" translatesAutoresizingMaskIntoConstraints="NO" id="Ztf-HT-Cjt">
<rect key="frame" x="0.0" y="14.5" width="15" height="15"/>
<rect key="frame" x="0.0" y="10.5" width="15" height="15"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="15" id="Cix-mS-byK"/>
@ -156,7 +156,7 @@
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" " textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="HfL-f9-uDZ">
<rect key="frame" x="0.0" y="29.5" width="15" height="15.5"/>
<rect key="frame" x="0.0" y="25.5" width="15" height="19.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
@ -204,13 +204,13 @@
<rect key="frame" x="0.0" y="0.0" width="15" height="45"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" " textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Ipg-dd-oaB">
<rect key="frame" x="0.0" y="0.0" width="15" height="14.5"/>
<rect key="frame" x="0.0" y="0.0" width="15" height="10.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="sm_managet_accounts" translatesAutoresizingMaskIntoConstraints="NO" id="0uv-Wu-2GP">
<rect key="frame" x="0.0" y="14.5" width="15" height="15"/>
<rect key="frame" x="0.0" y="10.5" width="15" height="15"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="width" constant="15" id="v2C-4e-lP0"/>
@ -218,7 +218,7 @@
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" " textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="SPi-rZ-Mcf">
<rect key="frame" x="0.0" y="29.5" width="15" height="15.5"/>
<rect key="frame" x="0.0" y="25.5" width="15" height="19.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>

30
GME Remit/Utilities/WebLinks/WkWebView/WkWebViewController.swift

@ -14,6 +14,7 @@ class WkWebViewController: UIViewController {
var webView: WKWebView!
var url: String?
var headers: [KftcHeader]?
weak var delegate: NewRegisterDelegate?
var activityIndicator: UIActivityIndicatorView?
let userContentController = WKUserContentController()
@ -116,11 +117,30 @@ extension WkWebViewController: WKScriptMessageHandler {
didReceive message: WKScriptMessage
) {
print(message.name)
if let body = message.body as? String {
self.alertWithOk(
message: body,
title: "Alert",
okAction: { self.dismiss(animated: true, completion: nil) })
if let body = message.body as? String, body.lowercased().contains("successful") {
guard let delegate = delegate else {
self.alert(type: .success, message: "Auto-Debit account register is complete.") {
self.dismiss(animated: true, completion: nil)
}
return
}
let kycMessage =
"""
Auto-Debit account register is complete.
To verify your bank account, move to the last step, the penny test
"""
alert(type: .success, message: kycMessage) {
self.dismiss(animated: true) {
delegate.newRegister(self, currentStep: .second, nextStep: .third)
}
}
} else {
alert(type: .error, message: "An error occurred.\nPlease contact customer service team.") {
self.dismiss(animated: true)
}
}
}
}

23
Pods/ChannelIO/ChannelIO/Assets/Images.xcassets/clip.imageset/Contents 2.json

@ -1,23 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "clip.png",
"scale" : "1x"
},
{
"scale" : "2x",
"idiom" : "universal",
"filename" : "clip@2x.png"
},
{
"filename" : "clip@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

23
Pods/ChannelIO/ChannelIO/Assets/Images.xcassets/clip.imageset/Contents 3.json

@ -1,23 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "clip.png",
"scale" : "1x"
},
{
"scale" : "2x",
"idiom" : "universal",
"filename" : "clip@2x.png"
},
{
"filename" : "clip@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

BIN
Pods/ChannelIO/ChannelIO/Assets/Images.xcassets/clip.imageset/clip 2.png

Before

Width: 24  |  Height: 24  |  Size: 721 B

BIN
Pods/ChannelIO/ChannelIO/Assets/Images.xcassets/clip.imageset/clip@2x 2.png

Before

Width: 48  |  Height: 48  |  Size: 1.4 KiB

BIN
Pods/ChannelIO/ChannelIO/Assets/Images.xcassets/clip.imageset/clip@3x 2.png

Before

Width: 72  |  Height: 72  |  Size: 2.1 KiB

23
Pods/ChannelIO/ChannelIO/Assets/Images.xcassets/exitPopup.imageset/Contents 2.json

@ -1,23 +0,0 @@
{
"images" : [
{
"filename" : "exitPopup.png",
"scale" : "1x",
"idiom" : "universal"
},
{
"filename" : "exitPopup@2x.png",
"scale" : "2x",
"idiom" : "universal"
},
{
"scale" : "3x",
"filename" : "exitPopup@3x.png",
"idiom" : "universal"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

23
Pods/ChannelIO/ChannelIO/Assets/Images.xcassets/exitPopup.imageset/Contents 3.json

@ -1,23 +0,0 @@
{
"images" : [
{
"filename" : "exitPopup.png",
"scale" : "1x",
"idiom" : "universal"
},
{
"filename" : "exitPopup@2x.png",
"scale" : "2x",
"idiom" : "universal"
},
{
"scale" : "3x",
"filename" : "exitPopup@3x.png",
"idiom" : "universal"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

BIN
Pods/ChannelIO/ChannelIO/Assets/Images.xcassets/exitPopup.imageset/exitPopup 2.png

Before

Width: 12  |  Height: 12  |  Size: 232 B

BIN
Pods/ChannelIO/ChannelIO/Assets/Images.xcassets/exitPopup.imageset/exitPopup@2x 2.png

Before

Width: 24  |  Height: 24  |  Size: 335 B

BIN
Pods/ChannelIO/ChannelIO/Assets/Images.xcassets/exitPopup.imageset/exitPopup@3x 2.png

Before

Width: 36  |  Height: 36  |  Size: 511 B

23
Pods/ChannelIO/ChannelIO/Assets/Images.xcassets/exitSmall.imageset/Contents 2.json

@ -1,23 +0,0 @@
{
"images" : [
{
"filename" : "exitSmall.png",
"scale" : "1x",
"idiom" : "universal"
},
{
"filename" : "exitSmall@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "exitSmall@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

23
Pods/ChannelIO/ChannelIO/Assets/Images.xcassets/exitSmall.imageset/Contents 3.json

@ -1,23 +0,0 @@
{
"images" : [
{
"filename" : "exitSmall.png",
"scale" : "1x",
"idiom" : "universal"
},
{
"filename" : "exitSmall@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "exitSmall@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

BIN
Pods/ChannelIO/ChannelIO/Assets/Images.xcassets/exitSmall.imageset/exitSmall 2.png

Before

Width: 8  |  Height: 8  |  Size: 183 B

BIN
Pods/ChannelIO/ChannelIO/Assets/Images.xcassets/exitSmall.imageset/exitSmall@2x 2.png

Before

Width: 16  |  Height: 16  |  Size: 303 B

BIN
Pods/ChannelIO/ChannelIO/Assets/Images.xcassets/exitSmall.imageset/exitSmall@3x 2.png

Before

Width: 24  |  Height: 24  |  Size: 454 B

Loading…
Cancel
Save