Browse Source

implemented redirect to auto debit page

pull/1/head
InKwon James Kim 5 years ago
parent
commit
02c6997d56
  1. 3
      GME Remit/AppDelegate.swift
  2. BIN
      GME Remit/Library/.DS_Store
  3. 8
      GME Remit/Library/CountryFlag.swift
  4. 85
      GME Remit/Library/Keyboard.swift
  5. 4
      GME Remit/Models/User.swift
  6. 16
      GME Remit/Modules/AutoDebitModules/AutoDebit/User Interface/View/AutoDebit.storyboard
  7. 62
      GME Remit/Modules/AutoDebitModules/AutoDebit/User Interface/View/AutoDebitViewController.swift
  8. 71
      GME Remit/Modules/Home/User Interface/View/Home.storyboard
  9. 145
      GME Remit/Modules/Home/User Interface/View/HomeViewController.swift
  10. 12
      GME Remit/Modules/Home/User Interface/View/HomeViewInterface.swift
  11. 13
      GME Remit/Modules/LauncherScreen/User Interface/View/LauncherScreenViewController.swift
  12. 49
      GME Remit/Modules/LauncherScreen/User Interface/Wireframe/LauncherScreenWireframe.swift
  13. 44
      GME Remit/Modules/RecipientModules/Recipients/User Interface/View/RecipientsViewController.swift
  14. 2
      GME Remit/Utilities/Database/GMEDB.swift

3
GME Remit/AppDelegate.swift

@ -62,6 +62,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
.shared
.app
.remove([.isOpenedTokenRenwalAlert, .isOpenedPopupNotification])
// FIXME: For Test
GMEDB.shared.user.set("autodebit", .redirectTo)
return true
}

BIN
GME Remit/Library/.DS_Store

8
GME Remit/Library/CountryFlag.swift

@ -1,8 +0,0 @@
//
// CountryFlag.swift
// GMERemittance
//
// Created by gme_2 on 22/08/2018.
// Copyright © 2018 Gobal Money Express Co. Ltd. All rights reserved.
//

85
GME Remit/Library/Keyboard.swift

@ -1,85 +0,0 @@
//
// Keyboard.swift
// GME Remit
//
// Created by gme_2 on 30/01/2019.
// Copyright © 2019 Gobal Money Express Co. Ltd. All rights reserved.
//
import Foundation
protocol KeyboardPresenterDelegate {
var presenter: TransKeyViewDelegate! {get}
func parentViewDidDisappear()
}
class KeyBoard {
static let shared = KeyBoard()
var presenter: TransKeyViewDelegate!
// keyboard
var mQwertyTransKeyView : TransKeyView!
var mNumberTransKeyView : TransKeyView!
var secureKey : NSData!
var numberCipherString : String!
var qwertyCipherString : String!
var isTranskeyShowing : Bool!
var isShowQwerty : Bool!
var isShowNumber : Bool!
private init() {
}
func setup() {
isShowNumber = false
isShowQwerty = false
isTranskeyShowing = false
let iv: Array<String> = ["M", "o", "b", "i", "l", "e", "T", "r" , "a", "n", "s", "K", "e", "y", "1", "0"]
secureKey = NSData(bytes: iv, length: 16)
NSLog("securekey : %@", secureKey)
// securekey : <d689e80d 01000000 01000000 00000000>
// real securekey : <4d6f6269 6c655472 616e734b 65793130>
setQwertyTranskey()
setNumberTranskey()
}
func setQwertyTranskey(){
mQwertyTransKeyView = TransKeyView()
mQwertyTransKeyView?.mTK_Init(presenter)
mQwertyTransKeyView?.delegate = presenter
mQwertyTransKeyView?.mTK_SetSecureKey(secureKey as Data!)
mQwertyTransKeyView?.mTK_Supported(byDeviceOrientation: SupportedByDevicePortraitAndLandscape)
mQwertyTransKeyView?.mTK_LicenseCheck("license_mtranskey")
}
func setNumberTranskey(){
mNumberTransKeyView = TransKeyView()
mNumberTransKeyView?.mTK_Init(presenter)
mNumberTransKeyView?.delegate = presenter
mNumberTransKeyView?.mTK_SetSecureKey(secureKey as Data!)
mNumberTransKeyView?.mTK_Supported(byDeviceOrientation: SupportedByDevicePortraitAndLandscape)
mNumberTransKeyView?.mTK_LicenseCheck("license_mtranskey")
}
}
extension KeyBoard: KeyboardPresenterDelegate {
func parentViewDidDisappear() {
mQwertyTransKeyView?.mTK_ClearDelegateSubviews()
mNumberTransKeyView?.mTK_ClearDelegateSubviews()
if isTranskeyShowing == false{
mQwertyTransKeyView?.delegate = nil;
mNumberTransKeyView?.delegate = nil;
}
}
}

4
GME Remit/Models/User.swift

@ -68,6 +68,7 @@ class User: Mappable {
var accessTokenRegTime: String?
var accessTokenExpTime: String?
var redirectTo: String?
required init?(map: Map) {
}
@ -112,6 +113,9 @@ class User: Mappable {
accessTokenRegTime <- map["accessTokenRegTime"]
accessTokenExpTime <- map["accessTokenExpTime"]
redirectTo <- map["redirectTo"]
}
}

16
GME Remit/Modules/AutoDebitModules/AutoDebit/User Interface/View/AutoDebit.storyboard

@ -82,7 +82,7 @@
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="iKW-nd-Zel">
<rect key="frame" x="177" y="15" width="40" height="40"/>
<rect key="frame" x="157.5" y="15" width="40" height="40"/>
<constraints>
<constraint firstAttribute="width" constant="40" id="nzP-kK-1ss"/>
<constraint firstAttribute="height" constant="40" id="oEA-1t-qWn"/>
@ -110,7 +110,7 @@
<autoresizingMask key="autoresizingMask"/>
<subviews>
<view opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="FIK-OV-SBT">
<rect key="frame" x="0.0" y="0.0" width="394" height="80"/>
<rect key="frame" x="0.0" y="0.0" width="355" height="80"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="M7t-0u-gH4">
<rect key="frame" x="20" y="20" width="40" height="40"/>
@ -123,16 +123,16 @@
<nil key="highlightedColor"/>
</label>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillProportionally" translatesAutoresizingMaskIntoConstraints="NO" id="eUe-lZ-JIJ">
<rect key="frame" x="80" y="10" width="309" height="60"/>
<rect key="frame" x="80" y="10" width="270" height="60"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Bank Alias" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="4" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="pti-fz-pDe">
<rect key="frame" x="0.0" y="0.0" width="309" height="31"/>
<rect key="frame" x="0.0" y="0.0" width="270" height="31"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Medium" family="San Francisco Display" pointSize="17"/>
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Bank Account" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="4" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="BvO-gw-4zj">
<rect key="frame" x="0.0" y="31" width="309" height="29"/>
<rect key="frame" x="0.0" y="31" width="270" height="29"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="16"/>
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
@ -192,6 +192,12 @@
<viewLayoutGuide key="safeArea" id="PXQ-gX-mza"/>
</view>
<navigationItem key="navigationItem" id="HBF-cT-CMV">
<barButtonItem key="leftBarButtonItem" systemItem="stop" id="ay5-rj-6Z5">
<color key="tintColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<connections>
<action selector="touchClose:" destination="EV3-Yh-COv" id="9iJ-av-LhH"/>
</connections>
</barButtonItem>
<rightBarButtonItems>
<barButtonItem id="AY7-S2-Bzm">
<color key="tintColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>

62
GME Remit/Modules/AutoDebitModules/AutoDebit/User Interface/View/AutoDebitViewController.swift

@ -24,7 +24,7 @@ class AutoDebitViewController: UIViewController {
let swipeInfoText = "swift_to_delete_account_text".localized()
}
// MARK:- IBOutlets
// MARK: IBOutlets
@IBOutlet private weak var tableView: UITableView!
@IBOutlet private weak var viewAddAccount: UIView!
@IBOutlet private weak var labelSwipeInfo: UILabel!
@ -32,7 +32,7 @@ class AutoDebitViewController: UIViewController {
@IBOutlet weak var addAccountButton: UIBarButtonItem!
@IBOutlet weak var refreshAccountButton: UIBarButtonItem!
// MARK:- properties
// MARK: properties
var presenter: AutoDebitModuleInterface?
var languages: [String] = ["--- Select Language ---"]
@ -51,7 +51,6 @@ class AutoDebitViewController: UIViewController {
let originalLanguages = kftcDetail?.languages?.map { $0.value ?? ""}
languages.append(contentsOf: originalLanguages ?? [])
}
}
}
@ -81,11 +80,10 @@ class AutoDebitViewController: UIViewController {
private let multiLanguages = MultiLanguages()
// MARK:- Life Cycle
// MARK: Life Cycle
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
// setLargeTitle()
setupNormalNavigation()
navigationItem.title = multiLanguages.navigationTitle
@ -99,8 +97,10 @@ class AutoDebitViewController: UIViewController {
setupDelegates()
viewAddAccount.layer.cornerRadius = 10
// navigationController?.navigationBar.shadowImage = UIImage()
// tabBarController?.tabBar.shadowImage = UIImage()
if self.presentingViewController == nil {
self.navigationItem.leftBarButtonItem = nil
}
}
override func viewWillDisappear(_ animated: Bool) {
@ -108,13 +108,9 @@ class AutoDebitViewController: UIViewController {
navigationItem.title = ""
view.endEditing(true)
// if #available(iOS 11.0, *) {
// navigationController?.navigationBar.prefersLargeTitles = false
// }
}
// MARK:- IBAction
// MARK: IBAction
@IBAction func touchAddAccountButton(_ sender: UIBarButtonItem) {
presenter?.goAddAccount(model: kftcDetail)
}
@ -140,16 +136,19 @@ class AutoDebitViewController: UIViewController {
self.languageTextField.placeholder = "token_renewal_placeholder_text".localized()
self.languageTextField.becomeFirstResponder()
self.languageTextField.keyboardToolbar.doneBarButton.setTarget(self, action: #selector(self.editingDidEnd(_:)))
self.languageTextField
.keyboardToolbar
.doneBarButton
.setTarget(self, action: #selector(self.editingDidEnd(_:)))
DispatchQueue.main.asyncAfter(deadline: .now()){[weak self] in
DispatchQueue.main.asyncAfter(deadline: .now()) {[weak self] in
guard let `self` = self else {return}
self.tableView.refreshControl?.endRefreshing()
}
},
cancelAction: {
DispatchQueue.main.asyncAfter(deadline: .now()){[weak self] in
DispatchQueue.main.asyncAfter(deadline: .now()) {[weak self] in
guard let `self` = self else {return}
self.tableView.refreshControl?.endRefreshing()
}
@ -157,17 +156,22 @@ class AutoDebitViewController: UIViewController {
)
}
@IBAction func touchClose(_ sender: UIBarButtonItem) {
//FIXME: For Test
// GMEDB.shared.user.set("", .redirectTo)
dismiss(animated: true, completion: nil)
}
@objc func editingDidEnd(_ textField: UITextField) {
presenter?.goRefreshToken(selectedLanguage: selectedLanguage)
}
@IBAction
private func addNewAccount(_ sender: UITapGestureRecognizer) {
// presenter?.goAddAccount(model: kftcDetail)
touchRefreshAccountButton(UIBarButtonItem())
}
// MARK:- other functions
// MARK: other functions
private func setupDelegates() {
tableView.delegate = self
@ -186,9 +190,7 @@ class AutoDebitViewController: UIViewController {
}
}
// MARK: - UITableViewDataSource
extension AutoDebitViewController: UITableViewDataSource {
func tableView(_ tableView: UITableView, estimatedHeightForRowAt indexPath: IndexPath) -> CGFloat {
return 82
@ -199,27 +201,28 @@ extension AutoDebitViewController: UITableViewDataSource {
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(
guard let cell = tableView.dequeueReusableCell(
withIdentifier: "AutoDebitTableViewCell",
for: indexPath
) as! AutoDebitTableViewCell
) as? AutoDebitTableViewCell else { return UITableViewCell() }
cell.setup(with: accounts?.elementAt(index: indexPath.row))
return cell
}
}
// MARK: - UITableViewDelegate
extension AutoDebitViewController: UITableViewDelegate {
func tableView(_ tableView: UITableView, editActionsForRowAt indexPath: IndexPath) -> [UITableViewRowAction]? {
func tableView(
_ tableView: UITableView,
editActionsForRowAt indexPath: IndexPath
) -> [UITableViewRowAction]? {
let delete = UITableViewRowAction(
style: .destructive,
title: multiLanguages.deleteText
) { [weak self] (action, indexPath) in
) { [weak self] (_, indexPath) in
guard let `self` = self else { return }
self.alertWithOkCancel(
@ -271,7 +274,7 @@ extension AutoDebitViewController: AutoDebitViewInterface {
hideProgressHud()
}
func setModel(with model: KFTCModel?){
func setModel(with model: KFTCModel?) {
kftcDetail = model
}
@ -285,7 +288,6 @@ extension AutoDebitViewController: AutoDebitViewInterface {
}
}
// MARK: - UIPickerViewDelegate
extension AutoDebitViewController: UIPickerViewDelegate {
func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? {
@ -299,7 +301,6 @@ extension AutoDebitViewController: UIPickerViewDelegate {
}
}
// MARK: - UIPickerViewDataSource
extension AutoDebitViewController: UIPickerViewDataSource {
func numberOfComponents(in pickerView: UIPickerView) -> Int {
@ -309,13 +310,11 @@ extension AutoDebitViewController: UIPickerViewDataSource {
func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int {
return languages.count
}
}
extension AutoDebitViewController {
private func addRefreshControlTableView() {
let colorOption = [NSAttributedString.Key.foregroundColor : AppConstants.themWhiteColor];
let colorOption = [NSAttributedString.Key.foregroundColor : AppConstants.themWhiteColor]
let title = NSAttributedString(string: "Token Renewal", attributes: colorOption)
@ -325,7 +324,6 @@ extension AutoDebitViewController {
refreshControl.addTarget(self, action: #selector(refresh), for: .valueChanged)
tableView.refreshControl = refreshControl
}
@objc

71
GME Remit/Modules/Home/User Interface/View/Home.storyboard

@ -1,5 +1,5 @@
<?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="ezt-uK-zb8">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="ezt-uK-zb8">
<device id="retina5_5" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
@ -28,16 +28,12 @@
<scene sceneID="R60-Pu-Hpy">
<objects>
<viewController storyboardIdentifier="HomeViewController" title="Home" id="HSb-ou-7T5" customClass="HomeViewController" customModule="GME_Remit" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="y1H-iV-BwG"/>
<viewControllerLayoutGuide type="bottom" id="PYB-Kq-ghm"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="qRs-xH-5Fi">
<rect key="frame" x="0.0" y="0.0" width="414" height="736"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="alB-Pe-T92">
<rect key="frame" x="0.0" y="0.0" width="414" height="100"/>
<rect key="frame" x="0.0" y="64" width="414" height="100"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="ic_home_verified" translatesAutoresizingMaskIntoConstraints="NO" id="UD8-ap-8xD">
<rect key="frame" x="24" y="14" width="67" height="72"/>
@ -46,8 +42,8 @@
<constraint firstAttribute="height" constant="72" id="sRu-sw-H5c"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Thank you for registering with us!" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="pcY-xj-hQb">
<rect key="frame" x="103" y="20" width="182" height="15"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Thank you for registering with us!" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" minimumFontSize="10" translatesAutoresizingMaskIntoConstraints="NO" id="pcY-xj-hQb">
<rect key="frame" x="103" y="20" width="234" height="15"/>
<constraints>
<constraint firstAttribute="height" constant="15" id="75Z-As-Aj4"/>
</constraints>
@ -55,7 +51,7 @@
<color key="textColor" red="0.92941176469999998" green="0.10980392160000001" blue="0.14117647059999999" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Your document is in verification process. This will not take long. Thereafter you can enjoy GME online service." lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="rwJ-pQ-p9z">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Your document is in verification process. This will not take long. Thereafter you can enjoy GME online service." lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" minimumFontSize="8" translatesAutoresizingMaskIntoConstraints="NO" id="rwJ-pQ-p9z">
<rect key="frame" x="103" y="43" width="234" height="24"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="10"/>
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="calibratedRGB"/>
@ -70,7 +66,7 @@
<state key="normal" image="ic_home_payoutLocation"/>
</button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="17X-fv-KyB" userLabel="Seperator">
<rect key="frame" x="0.0" y="99.666666666666671" width="414" height="0.3333333333333286"/>
<rect key="frame" x="0.0" y="99.666666666666657" width="414" height="0.3333333333333286"/>
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="0.5" id="bf7-EA-sF4"/>
@ -83,10 +79,11 @@
<constraint firstItem="3BK-NH-Zcv" firstAttribute="top" secondItem="alB-Pe-T92" secondAttribute="top" constant="30" id="0e8-nG-WI9"/>
<constraint firstItem="pcY-xj-hQb" firstAttribute="leading" secondItem="UD8-ap-8xD" secondAttribute="trailing" constant="12" id="9Cq-J8-5SO"/>
<constraint firstItem="UD8-ap-8xD" firstAttribute="top" secondItem="alB-Pe-T92" secondAttribute="top" constant="14" id="9lT-Dr-BKX"/>
<constraint firstItem="h5S-h2-Ool" firstAttribute="bottom" secondItem="17X-fv-KyB" secondAttribute="bottom" id="Knu-hh-TfY"/>
<constraint firstItem="pcY-xj-hQb" firstAttribute="width" secondItem="rwJ-pQ-p9z" secondAttribute="width" id="Fy9-CI-vKc"/>
<constraint firstAttribute="bottom" secondItem="17X-fv-KyB" secondAttribute="bottom" id="Knu-hh-TfY"/>
<constraint firstItem="pcY-xj-hQb" firstAttribute="top" secondItem="alB-Pe-T92" secondAttribute="top" constant="20" id="NF9-W0-XUH"/>
<constraint firstItem="UD8-ap-8xD" firstAttribute="leading" secondItem="alB-Pe-T92" secondAttribute="leading" constant="24" id="NOd-Rk-Zvp"/>
<constraint firstItem="17X-fv-KyB" firstAttribute="leading" secondItem="h5S-h2-Ool" secondAttribute="leading" id="Umi-eM-VdQ"/>
<constraint firstItem="17X-fv-KyB" firstAttribute="leading" secondItem="alB-Pe-T92" secondAttribute="leading" id="Umi-eM-VdQ"/>
<constraint firstAttribute="height" constant="100" id="VxG-Dr-LRY"/>
<constraint firstItem="3BK-NH-Zcv" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="rwJ-pQ-p9z" secondAttribute="trailing" constant="20" id="gP0-Km-0ya"/>
<constraint firstItem="rwJ-pQ-p9z" firstAttribute="leading" secondItem="UD8-ap-8xD" secondAttribute="trailing" constant="12" id="gTh-y1-VUj"/>
@ -94,10 +91,12 @@
<constraint firstAttribute="trailing" secondItem="3BK-NH-Zcv" secondAttribute="trailing" constant="16" id="njV-wa-Fwf"/>
<constraint firstItem="rwJ-pQ-p9z" firstAttribute="top" secondItem="pcY-xj-hQb" secondAttribute="bottom" constant="8" id="q0h-qE-G0m"/>
</constraints>
<viewLayoutGuide key="safeArea" id="h5S-h2-Ool"/>
<connections>
<outletCollection property="gestureRecognizers" destination="G3V-VT-9Qm" appends="YES" id="0RA-Gg-BgB"/>
</connections>
</view>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" dataMode="prototypes" style="plain" separatorStyle="none" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="wXh-zk-jWw">
<rect key="frame" x="0.0" y="100" width="414" height="587"/>
<rect key="frame" x="0.0" y="164" width="414" height="523"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" selectionStyle="none" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="HomeRemainingLimitTableViewCell" rowHeight="115" id="rcn-u6-1gx" customClass="HomeRemainingLimitTableViewCell" customModule="GME_Remit" customModuleProvider="target">
@ -108,28 +107,28 @@
<autoresizingMask key="autoresizingMask"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="wLs-Rj-kxu">
<rect key="frame" x="15" y="10" width="384" height="84.333333333333329"/>
<rect key="frame" x="15" y="10" width="384" height="83.666666666666671"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" alignment="center" spacing="4" translatesAutoresizingMaskIntoConstraints="NO" id="ybO-Kz-ezE">
<rect key="frame" x="0.0" y="0.0" width="384" height="42.333333333333336"/>
<rect key="frame" x="0.0" y="0.0" width="384" height="41.666666666666664"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Remaining Yearly Limit" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="q5T-Xf-a5s">
<rect key="frame" x="114.33333333333333" y="0.0" width="155.33333333333337" height="18"/>
<rect key="frame" x="116" y="0.0" width="152" height="17.666666666666668"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Bold" family="San Francisco Display" pointSize="15"/>
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<stackView opaque="NO" contentMode="scaleToFill" alignment="center" spacing="2" translatesAutoresizingMaskIntoConstraints="NO" id="Ofo-oE-AGa">
<rect key="frame" x="138.66666666666666" y="22" width="106.66666666666666" height="20.333333333333329"/>
<rect key="frame" x="135.66666666666666" y="21.666666666666668" width="113" height="20.000000000000004"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="87473839" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="8Bf-q6-azV">
<rect key="frame" x="0.0" y="0.0" width="73.333333333333329" height="20.333333333333332"/>
<rect key="frame" x="0.0" y="0.0" width="75.666666666666671" height="20"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="17"/>
<color key="textColor" red="0.92941176469999998" green="0.10980392160000001" blue="0.14117647059999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="USD" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="XTv-9z-6sB">
<rect key="frame" x="75.333333333333343" y="0.0" width="31.333333333333329" height="20.333333333333332"/>
<rect key="frame" x="77.666666666666686" y="0.0" width="35.333333333333343" height="20"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="17"/>
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
@ -139,14 +138,14 @@
</subviews>
</stackView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="4Ze-gK-s6z">
<rect key="frame" x="0.0" y="52.333333333333336" width="384" height="2"/>
<rect key="frame" x="0.0" y="51.666666666666664" width="384" height="2"/>
<color key="backgroundColor" red="0.90588235289999997" green="0.92941176469999998" blue="0.94901960780000005" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="2" id="h7h-4F-Ddy"/>
</constraints>
</view>
<stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Peb-Sn-rcC">
<rect key="frame" x="0.0" y="64.333333333333329" width="384" height="20"/>
<rect key="frame" x="0.0" y="63.666666666666671" width="384" height="20"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="dzi-vM-GUm">
<rect key="frame" x="0.0" y="0.0" width="58.666666666666664" height="20"/>
@ -184,7 +183,7 @@
<rect key="frame" x="0.0" y="0.0" width="43.666666666666664" height="20"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="1000" verticalHuggingPriority="251" text="98877" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="qFV-c8-8UI">
<rect key="frame" x="5" y="3.0000000000000009" width="33.666666666666664" height="14.333333333333336"/>
<rect key="frame" x="5" y="3" width="33.666666666666664" height="14"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="15" id="71F-b2-SSk"/>
@ -282,7 +281,7 @@
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Send Money" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="1gB-BN-h1P">
<rect key="frame" x="24" y="121.66666666666667" width="122" height="15.666666666666671"/>
<rect key="frame" x="24" y="121.66666666666667" width="122" height="15.333333333333329"/>
<fontDescription key="fontDescription" name="SanFranciscoText-Bold" family="San Francisco Text" pointSize="13"/>
<color key="textColor" white="0.33333333329999998" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
@ -341,17 +340,18 @@
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="alB-Pe-T92" secondAttribute="trailing" id="44c-9q-5Zy"/>
<constraint firstItem="wXh-zk-jWw" firstAttribute="leading" secondItem="qRs-xH-5Fi" secondAttribute="leading" id="CtQ-HI-xXr"/>
<constraint firstItem="0Kl-lY-qUa" firstAttribute="trailing" secondItem="alB-Pe-T92" secondAttribute="trailing" id="44c-9q-5Zy"/>
<constraint firstItem="wXh-zk-jWw" firstAttribute="leading" secondItem="0Kl-lY-qUa" secondAttribute="leading" id="CtQ-HI-xXr"/>
<constraint firstItem="wXh-zk-jWw" firstAttribute="top" secondItem="alB-Pe-T92" secondAttribute="bottom" id="N4D-FN-dqe"/>
<constraint firstAttribute="trailing" secondItem="wXh-zk-jWw" secondAttribute="trailing" id="OuN-dY-tYN"/>
<constraint firstItem="alB-Pe-T92" firstAttribute="leading" secondItem="qRs-xH-5Fi" secondAttribute="leading" id="Req-1D-gfY"/>
<constraint firstItem="PYB-Kq-ghm" firstAttribute="top" secondItem="wXh-zk-jWw" secondAttribute="bottom" id="Ro3-6E-ZmF"/>
<constraint firstItem="alB-Pe-T92" firstAttribute="top" secondItem="qRs-xH-5Fi" secondAttribute="top" id="u2K-G9-1E9"/>
<constraint firstItem="0Kl-lY-qUa" firstAttribute="trailing" secondItem="wXh-zk-jWw" secondAttribute="trailing" id="OuN-dY-tYN"/>
<constraint firstItem="alB-Pe-T92" firstAttribute="leading" secondItem="0Kl-lY-qUa" secondAttribute="leading" id="Req-1D-gfY"/>
<constraint firstItem="0Kl-lY-qUa" firstAttribute="bottom" secondItem="wXh-zk-jWw" secondAttribute="bottom" id="Ro3-6E-ZmF"/>
<constraint firstItem="alB-Pe-T92" firstAttribute="top" secondItem="0Kl-lY-qUa" secondAttribute="top" id="u2K-G9-1E9"/>
</constraints>
<viewLayoutGuide key="safeArea" id="0Kl-lY-qUa"/>
</view>
<navigationItem key="navigationItem" id="JSG-8j-YZS">
<barButtonItem key="rightBarButtonItem" title="Item" id="Fwg-iC-mji">
<barButtonItem key="rightBarButtonItem" title="CS" id="Fwg-iC-mji">
<connections>
<action selector="touchSupportBarButton:" destination="HSb-ou-7T5" id="LHW-Qg-bRB"/>
</connections>
@ -359,20 +359,21 @@
</navigationItem>
<simulatedTabBarMetrics key="simulatedBottomBarMetrics"/>
<connections>
<outlet property="messageLeftImageview" destination="UD8-ap-8xD" id="VYm-DS-yTJ"/>
<outlet property="messageRightButton" destination="3BK-NH-Zcv" id="nqv-k0-jW6"/>
<outlet property="messageTitleLabel" destination="pcY-xj-hQb" id="TA6-79-Fl5"/>
<outlet property="seperatorView" destination="17X-fv-KyB" id="dCf-y3-EMS"/>
<outlet property="supportBarButton" destination="Fwg-iC-mji" id="0ON-4r-rO2"/>
<outlet property="tableView" destination="wXh-zk-jWw" id="FZk-dJ-oM4"/>
<outlet property="thankyouTitleLabel" destination="pcY-xj-hQb" id="pvR-3R-j3Y"/>
<outlet property="verificationHeaderLeftImageview" destination="UD8-ap-8xD" id="VYm-DS-yTJ"/>
<outlet property="verificationHeaderRightButton" destination="3BK-NH-Zcv" id="nqv-k0-jW6"/>
<outlet property="tapMessageViewGestrueRecognizer" destination="G3V-VT-9Qm" id="XVK-LS-nug"/>
<outlet property="verificationNoticeHeightConstraint" destination="VxG-Dr-LRY" id="80H-Oh-yg2"/>
<outlet property="verificationNoticeView" destination="alB-Pe-T92" id="1Di-cQ-gdP"/>
<outlet property="verificationText" destination="rwJ-pQ-p9z" id="40u-EV-EKU"/>
<outlet property="verificationTitleLabel" destination="pcY-xj-hQb" id="TA6-79-Fl5"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="8je-5K-XuW" userLabel="First Responder" sceneMemberID="firstResponder"/>
<tapGestureRecognizer id="ZRA-EC-6mr"/>
<tapGestureRecognizer id="G3V-VT-9Qm"/>
</objects>
<point key="canvasLocation" x="814.49275362318849" y="232.33695652173915"/>
</scene>

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

@ -10,6 +10,7 @@ import UIKit
import Crashlytics
import Localize_Swift
import ChannelIO
import LGSideMenuController
class HomeViewController: UIViewController, UICollectionViewDelegateFlowLayout {
enum Sections: Int {
@ -38,17 +39,17 @@ class HomeViewController: UIViewController, UICollectionViewDelegateFlowLayout {
@IBOutlet private weak var verificationNoticeView: UIView!
@IBOutlet private weak var verificationText: UILabel!
@IBOutlet private weak var verificationTitleLabel: UILabel!
@IBOutlet private weak var verificationHeaderLeftImageview: UIImageView!
@IBOutlet private weak var verificationHeaderRightButton: UIButton!
@IBOutlet private weak var messageTitleLabel: UILabel!
@IBOutlet private weak var messageLeftImageview: UIImageView!
@IBOutlet private weak var messageRightButton: UIButton!
@IBOutlet private var tapMessageViewGestrueRecognizer: UITapGestureRecognizer!
@IBOutlet private weak var seperatorView: UIView!
// title labels
@IBOutlet private weak var thankyouTitleLabel: UILabel!
@IBOutlet private weak var supportBarButton: UIBarButtonItem!
// MARK: Properties
lazy var blobView = UIView()
var messageCount: String? {
didSet {
@ -66,7 +67,7 @@ class HomeViewController: UIViewController, UICollectionViewDelegateFlowLayout {
didSet {
// update
self.save(user: user)
self.showUnverifiedNotice()
setMessageView()
self.tableView.reloadData()
updateBalance()
self.update()
@ -109,7 +110,6 @@ class HomeViewController: UIViewController, UICollectionViewDelegateFlowLayout {
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
configureViews()
self.tableView.reloadData()
NotificationCenter.default.addObserver(
@ -226,6 +226,9 @@ class HomeViewController: UIViewController, UICollectionViewDelegateFlowLayout {
private func setup() {
// all setup should be done here
self.verificationNoticeHeightConstraint.constant = 0
self.verificationNoticeView.alpha = 0
setupDelegates()
setupNotifications()
addRefreshControlTableView()
@ -457,72 +460,75 @@ class HomeViewController: UIViewController, UICollectionViewDelegateFlowLayout {
}
private func showUnverifiedNotice() {
setVerificationText()
if shouldShowUnverifiedNotice() {
UIView.animate(withDuration: 0.33) {
self.verificationNoticeHeightConstraint.constant = Constants.verificationNoticeHeight
self.verificationNoticeView.alpha = 1
self.view.layoutIfNeeded()
}
} else {
self.verificationNoticeHeightConstraint.constant = 0
self.verificationNoticeView.alpha = 0
self.view.layoutIfNeeded()
}
}
private func setVerificationText() {
private func setMessageView() {
if didSubmitKycAndNotVerified() {
verificationTitleLabel.text = StringConstants().verificationInProcessTitleText
self.verificationText.text = StringConstants().soonToUseGmeServicesTitle
self.verificationHeaderLeftImageview.image = #imageLiteral(resourceName: "ic_home_verified")
self.verificationHeaderRightButton.setImage(#imageLiteral(resourceName: "ic_home_payoutLocation"), for: UIControl.State.normal)
showWaitVerifyMessage()
setNavBar(isUseMenu: true)
} else {
self.verificationNoticeHeightConstraint.constant = 0
self.verificationNoticeView.alpha = 0
let redirect = GMEDB.shared.user.string(.redirectTo) ?? ""
switch redirect {
case "autodebit":
showAutoDebitMessage()
setNavBar(isUseMenu: false)
default:
removeAllMessage()
setNavBar(isUseMenu: true)
}
}
}
private func didSubmitKycAndNotVerified() -> Bool {
return Utility.didSubmitKyc() && !Utility.isVerifiedUser()
}
private func showWaitVerifyMessage() {
self.verificationNoticeHeightConstraint.constant = 100
self.verificationNoticeView.alpha = 0
private func didSubmitKycAndVerified() -> Bool {
return Utility.didSubmitKyc() && Utility.isVerifiedUser()
messageTitleLabel.text = StringConstants().verificationInProcessTitleText
self.verificationText.text = StringConstants().soonToUseGmeServicesTitle
self.messageLeftImageview.image = #imageLiteral(resourceName: "ic_home_verified")
self.messageRightButton.setImage(#imageLiteral(resourceName: "ic_home_payoutLocation"), for: .normal)
}
private func didNotSubmitKycAndNotVerified() -> Bool {
return !Utility.didSubmitKyc() && !Utility.isVerifiedUser()
}
private func showAutoDebitMessage() {
self.verificationNoticeHeightConstraint.constant = 100
self.verificationNoticeView.alpha = 1
messageTitleLabel.text = "Move to autodebit regist"
self.verificationText.text = "You have to regist your autodebit account"
self.messageLeftImageview.image = #imageLiteral(resourceName: "ic_home_verified")
self.messageRightButton.setImage(#imageLiteral(resourceName: "ic_home_payoutLocation"), for: .normal)
private func shouldShowPennyTestError() -> Bool {
return Utility.shouldShowPennyTestError()
blobView.removeFromSuperview()
blobView = UIView(
frame: CGRect(x: 0, y: 164, width: view.frame.width, height: view.frame.height)
)
blobView.backgroundColor = .init(white: 0, alpha: 0.5)
tabBarController?.view.addSubview(blobView)
tapMessageViewGestrueRecognizer.addTarget(self, action: #selector(tapMessageView(_:)))
}
private func shouldShowUnverifiedNotice() -> Bool {
return !self.isUserVerified()
@objc private func tapMessageView(_ sender: UITapGestureRecognizer) {
blobView.removeFromSuperview()
let navigationVC = UINavigationController(rootViewController: AutoDebitWireframe().getMainView())
tabBarController?.present(navigationVC, animated: true, completion: nil)
}
private func configureViews() {
private func removeAllMessage() {
self.verificationNoticeHeightConstraint.constant = 0
showUnverifiedNotice()
setNavBar()
self.verificationNoticeView.alpha = 0
blobView.removeFromSuperview()
}
func setNavBar() {
func setNavBar(isUseMenu: Bool) {
let selector = #selector(self.showSideMenu)
self.setupPicturedNavBar(sideMenuAction: selector)
isUseMenu ? setupPicturedNavBar(sideMenuAction: selector) : setupPicturedNavBar(sideMenuAction: nil)
}
@objc func showSideMenu() {
sideMenuController?.showLeftViewAnimated()
}
private func isUserVerified() -> Bool {
return Utility.isVerifiedUser()
}
@objc private func showSendMoney() {
let kycSubmited = user?.kyc ?? false
let pennyTestComplete = Utility.pennyTestVerified()
@ -549,7 +555,6 @@ class HomeViewController: UIViewController, UICollectionViewDelegateFlowLayout {
return
}
if isUserVerified() {
// remaining of previous developer. I dont have much time. Later. TODO: refracor
if let navigation = self.navigationController {
let wireframe = ResendWireframe()
wireframe.pushMainView(in: navigation)
@ -569,13 +574,6 @@ class HomeViewController: UIViewController, UICollectionViewDelegateFlowLayout {
}
self.alert(message: "This feature is coming soon")
return
if isUserVerified() {
return
self.performSegue(withIdentifier: "mobileRecharge", sender: nil)
} else {
self.showUnVerifiedMessage()
}
}
@objc private func showTodaysRate() {
@ -633,11 +631,40 @@ class HomeViewController: UIViewController, UICollectionViewDelegateFlowLayout {
}
}
// MARK: - Other functions
extension HomeViewController {
private func isUserVerified() -> Bool {
return Utility.isVerifiedUser()
}
private func didSubmitKycAndNotVerified() -> Bool {
return Utility.didSubmitKyc() && !Utility.isVerifiedUser()
}
private func didSubmitKycAndVerified() -> Bool {
return Utility.didSubmitKyc() && Utility.isVerifiedUser()
}
private func didNotSubmitKycAndNotVerified() -> Bool {
return !Utility.didSubmitKyc() && !Utility.isVerifiedUser()
}
private func shouldShowPennyTestError() -> Bool {
return Utility.shouldShowPennyTestError()
}
private func shouldShowUnverifiedNotice() -> Bool {
return !self.isUserVerified()
}
}
// MARK: HomeViewInterface
extension HomeViewController: HomeViewInterface {
func setHotLine(with model: [HotLine]?) {
hotLines = model
}
func show(model: User) {
self.user = model
}
@ -816,7 +843,6 @@ extension HomeViewController {
private func checkKFTCToken() {
if !GMEDB.shared.app.bool(.isOpenedTokenRenwalAlert) {
// TODO: Show Alert for token refresh (navigation push)
guard
let remind = GMEDB.shared.user.string(.remindKFTCTokenDay),
let remindDay = Int(remind) else {
@ -898,7 +924,6 @@ extension HomeViewController {
@unknown default: message += "(8)"
}
self.alert(message: message)
}

12
GME Remit/Modules/Home/User Interface/View/HomeViewInterface.swift

@ -7,11 +7,11 @@
//
protocol HomeViewInterface: class {
func show(model: User)
func show(error: String)
func showLoading()
func hideLoading()
func endRefreshing()
func show(panicError: String)
func show(model: User)
func show(error: String)
func showLoading()
func hideLoading()
func endRefreshing()
func show(panicError: String)
func setHotLine(with model: [HotLine]?)
}

13
GME Remit/Modules/LauncherScreen/User Interface/View/LauncherScreenViewController.swift

@ -8,7 +8,6 @@
import UIKit
class LauncherScreenViewController: UIViewController {
// MARK: Properties
@ -18,7 +17,7 @@ class LauncherScreenViewController: UIViewController {
private var isShow = false
private var window: UIWindow? {
if let app = UIApplication.shared.delegate as? AppDelegate{
if let app = UIApplication.shared.delegate as? AppDelegate {
return app.window
} else {
return nil
@ -26,12 +25,8 @@ class LauncherScreenViewController: UIViewController {
}
// MARK: Computed Properties
// MARK: IBOutlets
// MARK: VC's Life cycle
override func viewDidLoad() {
@ -49,8 +44,6 @@ class LauncherScreenViewController: UIViewController {
}
// MARK: IBActions
}
// MARK: LauncherScreenViewInterface
@ -89,11 +82,10 @@ extension LauncherScreenViewController {
}
}
// MARK: - Login Logic
extension LauncherScreenViewController {
private func setEntryPoint() {
guard let _ = KeyChain.shared.get(key: .id),
guard KeyChain.shared.get(key: .id) != nil,
(KeyChain.shared.get(key: .login) ?? "1") == "1" ? true : false else {
presenter?.goSplashScreen()
return
@ -102,4 +94,3 @@ extension LauncherScreenViewController {
presenter?.openAuthenticationScreen()
}
}

49
GME Remit/Modules/LauncherScreen/User Interface/Wireframe/LauncherScreenWireframe.swift

@ -51,10 +51,13 @@ extension LauncherScreenWireframe: LauncherScreenWireframeInput {
}
}
// MARK: - BiometricAuthenticationViewControllerDelegate
extension LauncherScreenWireframe: BiometricAuthenticationViewControllerDelegate {
func viewController(_ viewController: BiometricAuthenticationViewController, informationTitleLabel titleLabel: UILabel, authenticationButton button: UIButton) {
func viewController(
_ viewController: BiometricAuthenticationViewController,
informationTitleLabel titleLabel: UILabel,
authenticationButton button: UIButton
) {
biometricViewController = viewController
titleLabel.text = "bio_login_intro_text".localized()
@ -89,7 +92,9 @@ extension LauncherScreenWireframe: BiometricAuthenticationViewControllerDelegate
}
}
func doSelectLocalAuthenticationPolicy(_ viewController: BiometricAuthenticationViewController) -> BiometricAuthenticationPolicy {
func doSelectLocalAuthenticationPolicy(
_ viewController: BiometricAuthenticationViewController
) -> BiometricAuthenticationPolicy {
return .deviceOwnerAuthenticationWithBiometrics
}
}
@ -106,7 +111,7 @@ extension LauncherScreenWireframe: SecureKeypadDelegate {
// MARK: - Other Methods
extension LauncherScreenWireframe {
private func doLogin(){
private func doLogin() {
biometricViewController?.showProgressHud()
let loginService = LoginService()
@ -128,36 +133,42 @@ extension LauncherScreenWireframe {
let mainWireFrame = MainWireframe.shared
let tabBarViewController = mainWireFrame?.getMainView()
let sidemenuVc = UIStoryboard(name: "SideMenu", bundle: nil).instantiateViewController(withIdentifier: "SideMenuViewController") as! SideMenuViewController
guard let sidemenuVc = UIStoryboard(name: "SideMenu", bundle: nil).instantiateViewController(
withIdentifier: "SideMenuViewController"
) as? SideMenuViewController else {
return
}
let sideMenuController = LGSideMenuController(rootViewController: tabBarViewController, leftViewController: sidemenuVc, rightViewController: nil)
let sideMenuController = LGSideMenuController(
rootViewController: tabBarViewController,
leftViewController: sidemenuVc,
rightViewController: nil
)
sideMenuController.rootViewLayerShadowColor = UIColor(white: 0.9, alpha: 0.6)
sideMenuController.rootViewLayerShadowRadius = 8.0
sideMenuController.leftViewPresentationStyle = .scaleFromBig
sideMenuController.leftViewWidth = UIScreen.main.bounds.width - 70.0
sideMenuController.leftViewBackgroundBlurEffect = UIBlurEffect(style: .regular)
if #available(iOS 10.0, *) {
sideMenuController.leftViewBackgroundBlurEffect = UIBlurEffect(style: .regular)
} else {
// Fallback on earlier versions
}
self.biometricViewController?.hideProgressHud()
self.biometricViewController?.dismiss(animated: true) {
self.window?.backgroundColor = sidemenuVc.view.backgroundColor
self.window?.rootViewController = sideMenuController
}
}) { (error) in
self.biometricViewController?.hideProgressHud()
self.biometricViewController?.alert(type: .error, message: error.localizedDescription, title: "Warning"){
// if failed login, remove all in keychain, change logout status and then go splash screen
KeyChain.shared.removeAll()
self.biometricViewController?.dismiss(animated: true) {
(self.view as? LauncherScreenViewController)?.presenter?.goSplashScreen()
},
failure: { (error) in
self.biometricViewController?.hideProgressHud()
self.biometricViewController?.alert(type: .error, message: error.localizedDescription, title: "Warning"){
// if failed login, remove all in keychain, change logout status and then go splash screen
KeyChain.shared.removeAll()
self.biometricViewController?.dismiss(animated: true) {
(self.view as? LauncherScreenViewController)?.presenter?.goSplashScreen()
}
}
}
}
)
}
}

44
GME Remit/Modules/RecipientModules/Recipients/User Interface/View/RecipientsViewController.swift

@ -9,6 +9,7 @@
import UIKit
import RxSwift
import RxCocoa
import Localize_Swift
class RecipientsViewController: UIViewController {
struct StringConstant {
@ -43,18 +44,29 @@ class RecipientsViewController: UIViewController {
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
title = "recipient_listing_title_text".localized()
self.navigationItem.title = "recipient_listing_title_text".localized()
setupNormalNavigation()
configureLanguage()
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
title = ""
self.navigationItem.title = ""
}
// MARK: IBActions
}
override func setupTabItem() {
let image = UIImage.init(named: "ic-sendmoney")
self.tabBarItem = UITabBarItem(
title: "send_money_title_text".localized(),
image: image, selectedImage: nil
)
self.tabBarItem.titlePositionAdjustment = UIOffset(
horizontal: 0,
vertical: UI_USER_INTERFACE_IDIOM() == .pad ? 2 : -6
)
}
}
// MARK: Other Functions
extension RecipientsViewController {
@ -66,6 +78,13 @@ extension RecipientsViewController {
private func setup() {
// all setup should be done here
setBinding()
NotificationCenter.default.addObserver(
self,
selector: #selector(setupTabItem),
name: NSNotification.Name(LCLLanguageChangeNotification),
object: nil
)
}
private func setBinding() {
@ -85,7 +104,9 @@ extension RecipientsViewController {
output
.recipients
.drive(tableView.rx.items(cellIdentifier: "RecipientCell")){ (index: Int, element: Recipient, cell: RecipientCell) in
.drive(
tableView.rx.items(cellIdentifier: "RecipientCell")
) { (_, element: Recipient, cell: RecipientCell) in
cell.setModel(with: element)
}
.disposed(by: disposeBag)
@ -108,8 +129,14 @@ extension RecipientsViewController {
// MARK: - UITableViewDelegate
extension RecipientsViewController: UITableViewDelegate {
func tableView(_ tableView: UITableView, editActionsForRowAt indexPath: IndexPath) -> [UITableViewRowAction]? {
let delete = UITableViewRowAction(style: .destructive, title: "delete_text".localized()) { (action, indexPath) in
func tableView(
_ tableView: UITableView,
editActionsForRowAt indexPath: IndexPath
) -> [UITableViewRowAction]? {
let delete = UITableViewRowAction(
style: .destructive,
title: "delete_text".localized()
) { (_, indexPath) in
self.alertWithOkCancel(
message: "delete_recipient_confirmation_text".localized(),
title: "alert_text".localized(),
@ -118,7 +145,10 @@ extension RecipientsViewController: UITableViewDelegate {
})
}
let edit = UITableViewRowAction(style: .normal, title: "edit_text".localized()) { (action, indexPath) in
let edit = UITableViewRowAction(
style: .normal,
title: "edit_text".localized()
) { (_, indexPath) in
self.editTrigger.onNext(indexPath)
}

2
GME Remit/Utilities/Database/GMEDB.swift

@ -61,6 +61,7 @@ class GMEDB {
case data
case isUseBiometricAuth = "com.gmeremit.isUseBiometricAuth"
case remindKFTCTokenDay
case redirectTo
}
enum AppKey: String, KeyProtocol {
@ -134,6 +135,7 @@ extension GMEDB {
.set(user?.availableBalance, .availableBalance)
.set(user?.accessTokenRegTime, .accessTokenRegTime)
.set(user?.accessTokenExpTime, .accessTokenExpTime)
.set(user?.redirectTo, .redirectTo)
return self.user
}

Loading…
Cancel
Save