Browse Source

added refresh ( Transaction History, Recharge history, Inbound accounts, Autodebit accounts)

pull/1/head
InKwon James Kim 5 years ago
parent
commit
4219b5518e
  1. 8
      GME Remit.xcodeproj/project.pbxproj
  2. 2
      GME Remit/Modules/ManageAccountsModules/AutoDebitModules/AutoDebit/Module Interface/AutoDebitModuleInterface.swift
  3. 34
      GME Remit/Modules/ManageAccountsModules/AutoDebitModules/AutoDebit/User Interface/Presenter/AutoDebitPresenter.swift
  4. 18
      GME Remit/Modules/ManageAccountsModules/AutoDebitModules/AutoDebit/User Interface/View/AutoDebit.storyboard
  5. 23
      GME Remit/Modules/ManageAccountsModules/AutoDebitModules/AutoDebit/User Interface/View/AutoDebitViewController.swift
  6. 4
      GME Remit/Modules/ManageAccountsModules/AutoDebitModules/AutoDebit/User Interface/Wireframe/AutoDebitWireframe.swift
  7. 2
      GME Remit/Modules/ManageAccountsModules/AutoDebitModules/AutoDebit/User Interface/Wireframe/AutoDebitWireframeInput.swift
  8. 22
      GME Remit/Modules/ManageAccountsModules/InboundAccounts/User Interface/Presenter/InboundAccountsPresenter.swift
  9. 18
      GME Remit/Modules/ManageAccountsModules/InboundAccounts/User Interface/View/InboundAccounts.storyboard
  10. 13
      GME Remit/Modules/ManageAccountsModules/InboundAccounts/User Interface/View/InboundAccountsViewController.swift
  11. 8
      GME Remit/Modules/ManageAccountsModules/InboundAccounts/User Interface/Wireframe/InboundAccountsWireframe.swift
  12. 4
      GME Remit/Modules/ManageAccountsModules/InboundAccounts/User Interface/Wireframe/InboundAccountsWireframeInput.swift
  13. 2
      GME Remit/Modules/ManageAccountsModules/TotalManageAccounts/User Interface/Presenter/TotalManageAccountsPresenter.swift
  14. 6
      GME Remit/Modules/ManageAccountsModules/TotalManageAccounts/User Interface/Wireframe/TotalManageAccountsWireframe.swift
  15. 2
      GME Remit/Modules/ManageAccountsModules/TotalManageAccounts/User Interface/Wireframe/TotalManageAccountsWireframeInput.swift
  16. 11
      GME Remit/Modules/PowerCallModules/RechargeHistory/User Interface/Presenter/RechargeHistoryPresenter.swift
  17. 21
      GME Remit/Modules/PowerCallModules/RechargeHistory/User Interface/View/RechargeHistoryViewController.swift
  18. 1
      GME Remit/Modules/RecipientModules/SetupRecipient/User Interface/View/ViewModel/SetupRecipientViewModel.swift
  19. 2
      GME Remit/Modules/RemittanceModules/InboundModules/AddInboundAccount/User Interface/View/AddInboundAccount.storyboard
  20. 10
      GME Remit/Modules/RemittanceModules/InboundModules/AddInboundAccount/User Interface/Wireframe/AddInboundAccountWireframe.swift
  21. 18
      GME Remit/Modules/RemittanceModules/InboundModules/InboundPennyTestSubmit/User Interface/View/InboundPennyTestSubmitViewController.swift
  22. 18
      GME Remit/Modules/RemittanceModules/InboundModules/InboundPennyTestSubmit/User Interface/Wireframe/InboundPennyTestSubmitWireframe.swift
  23. 14
      GME Remit/Modules/RemittanceModules/InboundModules/InboundReceipt/User Interface/Presenter/InboundReceiptPresenter.swift
  24. 13
      GME Remit/Modules/RemittanceModules/InboundModules/InboundReceipt/User Interface/Wireframe/InboundReceiptWireframe.swift
  25. 3
      GME Remit/Modules/RemittanceModules/InboundModules/InboundReceipt/User Interface/Wireframe/InboundReceiptWireframeInput.swift
  26. 75
      GME Remit/Modules/RemittanceModules/TransactionHistoryModules/TransactionHistory/User Interface/View/TransactionHistory.storyboard
  27. 8
      GME Remit/Modules/RemittanceModules/TransactionHistoryModules/TransactionHistory/User Interface/View/TransactionHistoryDatePicker.storyboard
  28. 35
      GME Remit/Modules/RemittanceModules/TransactionHistoryModules/TransactionHistory/User Interface/View/TransactionHistoryViewController.swift

8
GME Remit.xcodeproj/project.pbxproj

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

2
GME Remit/Modules/ManageAccountsModules/AutoDebitModules/AutoDebit/Module Interface/AutoDebitModuleInterface.swift

@ -29,4 +29,6 @@ protocol AutoDebitModuleInterface: class {
/// - model: KFTCModel
/// - selectedLanguage: KftcLanguage
func goRefreshToken(selectedLanguage: KftcLanguage?)
func openRegisterInboundAccount(with model: PenneyTestRequest)
}

34
GME Remit/Modules/ManageAccountsModules/AutoDebitModules/AutoDebit/User Interface/Presenter/AutoDebitPresenter.swift

@ -9,17 +9,17 @@
import Foundation
class AutoDebitPresenter {
// MARK: Properties
weak var view: AutoDebitViewInterface?
var interactor: AutoDebitInteractorInput?
var wireframe: AutoDebitWireframeInput?
// MARK: Converting entities
// MARK: Properties
weak var view: AutoDebitViewInterface?
var interactor: AutoDebitInteractorInput?
var wireframe: AutoDebitWireframeInput?
// MARK: Converting entities
}
// MARK: AutoDebit module interface
// MARK: AutoDebit module interface
extension AutoDebitPresenter: AutoDebitModuleInterface {
func fetchKFTCBankAccountList() {
@ -39,6 +39,10 @@ extension AutoDebitPresenter: AutoDebitModuleInterface {
func goRefreshToken(selectedLanguage: KftcLanguage?) {
interactor?.refreshToken(language: selectedLanguage)
}
func openRegisterInboundAccount(with model: PenneyTestRequest) {
wireframe?.openRegisterInboundAccount(with: model, delegate: self)
}
}
// MARK: AutoDebit interactor output interface
@ -72,3 +76,15 @@ extension AutoDebitPresenter: AutoDebitInteractorOutput {
view?.didFailDeleteAccount(with: error)
}
}
extension AutoDebitPresenter: InboundPennyTestSubmitDelegate {
func didSuccess(_ viewController: UIViewController) {
view?.startLoading()
interactor?.fetchKFTCBankAccountList()
}
func didCancel(_ viewController: UIViewController) {
view?.startLoading()
interactor?.fetchKFTCBankAccountList()
}
}

18
GME Remit/Modules/ManageAccountsModules/AutoDebitModules/AutoDebit/User Interface/View/AutoDebit.storyboard

@ -57,11 +57,6 @@
<constraint firstAttribute="bottom" secondItem="bme-6F-zQd" secondAttribute="bottom" constant="20" id="iYd-2F-OT3"/>
<constraint firstItem="bme-6F-zQd" firstAttribute="leading" secondItem="L6q-bk-mo5" secondAttribute="leading" constant="20" id="kb8-ba-VcO"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="shadowBackground">
<color key="value" name="ThemeMainBackground"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<outletCollection property="gestureRecognizers" destination="fSh-Qk-b5j" appends="YES" id="xdQ-x2-Je2"/>
</connections>
@ -318,19 +313,6 @@
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="FWb-nX-ka2" userLabel="First Responder" sceneMemberID="firstResponder"/>
<customObject id="Wnv-DB-EeR" customClass="RAMBounceAnimation" customModule="RAMAnimatedTabBarController">
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="textSelectedColor">
<color key="value" red="0.92549019610000005" green="0.10980392160000001" blue="0.14117647059999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="iconSelectedColor">
<color key="value" red="0.92549019610000005" green="0.10980392160000001" blue="0.14117647059999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="duration">
<real key="value" value="0.33000000000000002"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</customObject>
<tapGestureRecognizer id="fSh-Qk-b5j">
<connections>
<action selector="addNewAccount:" destination="EV3-Yh-COv" id="Qd3-DD-CKC"/>

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

@ -44,6 +44,7 @@ class AutoDebitViewController: UIViewController {
private var kftcDetail: KFTCModel? {
didSet {
tableView.refreshControl?.endRefreshing()
accounts = kftcDetail?.model
tableView.reloadData()
@ -165,12 +166,32 @@ class AutoDebitViewController: UIViewController {
configureText()
view.addSubview(languageTextField)
addRefreshControl()
}
private func configureText() {
tokenRenewalLabel.text = multiLanguages.tokenRenewalText
deleteButtonInfoLabel.text = "Delete Account"
}
private func addRefreshControl() {
let colorOption = [NSAttributedString.Key.foregroundColor : UIColor.themeWhite]
let title = NSAttributedString(string: "pull to refresh", attributes: colorOption)
refreshControl.attributedTitle = title
refreshControl.backgroundColor = .themeBlue
refreshControl.tintColor = .themeWhite
refreshControl.addTarget(self, action: #selector(refresh), for: .valueChanged)
tableView.refreshControl = refreshControl
}
@objc
private func refresh() {
presenter?.fetchKFTCBankAccountList()
}
}
// MARK: - UITableViewDataSource
@ -281,7 +302,7 @@ extension AutoDebitViewController: AutoDebitTableViewCellDelegate {
account: model?.accountNumMasked ?? ""
)
AddInboundAccountWireframe().open(with: model, source: self)
presenter?.openRegisterInboundAccount(with: model)
}
func delete(of model: Account?) {

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

@ -51,4 +51,8 @@ extension AutoDebitWireframe: AutoDebitWireframeInput {
view.present(navigationController, animated: true, completion: nil)
}
func openRegisterInboundAccount(with model: PenneyTestRequest, delegate: InboundPennyTestSubmitDelegate?) {
AddInboundAccountWireframe().open(with: model, delegate: delegate, source: view)
}
}

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

@ -19,4 +19,6 @@ protocol AutoDebitWireframeInput: WireframeInput {
/// - hearder: [String: String]]
/// - url: String
func goRefreshToken(header: [KftcHeader]?, url: String?)
func openRegisterInboundAccount(with model: PenneyTestRequest, delegate: InboundPennyTestSubmitDelegate?)
}

22
GME Remit/Modules/ManageAccountsModules/InboundAccounts/User Interface/Presenter/InboundAccountsPresenter.swift

@ -17,6 +17,7 @@ class InboundAccountsPresenter: ViewModelType {
let viewWillAppear: Driver<Void>
let add: Driver<Void>
let pennyTest: Driver<PenneyTestRequest>
let refresh: Driver<Void>
}
struct Output {
@ -38,11 +39,16 @@ class InboundAccountsPresenter: ViewModelType {
}).disposed(by: disposeBag)
input.add.drive(onNext: {[weak self] in
self?.wireframe?.addAccount()
self?.wireframe?.addAccount(delegate: self)
}).disposed(by: disposeBag)
input.pennyTest.drive(onNext: {[weak self] in
self?.wireframe?.pennyTest(with: $0)
self?.wireframe?.pennyTest(with: $0, delegate: self)
}).disposed(by: disposeBag)
input.refresh.drive(onNext: {[weak self] in
self?.progressLinker.onNext(true)
self?.interactor?.fetchAccounts()
}).disposed(by: disposeBag)
return Output(
@ -65,3 +71,15 @@ extension InboundAccountsPresenter: InboundAccountsInteractorOutput {
errorLinker.onNext(error)
}
}
extension InboundAccountsPresenter: InboundPennyTestSubmitDelegate {
func didSuccess(_ viewController: UIViewController) {
progressLinker.onNext(true)
interactor?.fetchAccounts()
}
func didCancel(_ viewController: UIViewController) {
progressLinker.onNext(true)
interactor?.fetchAccounts()
}
}

18
GME Remit/Modules/ManageAccountsModules/InboundAccounts/User Interface/View/InboundAccounts.storyboard

@ -31,7 +31,7 @@
<color key="separatorColor" name="ThemeSeparate"/>
<inset key="separatorInset" minX="5" minY="0.0" maxX="5" maxY="0.0"/>
<view key="tableFooterView" contentMode="scaleToFill" id="FKJ-fI-LmX">
<rect key="frame" x="0.0" y="154" width="355" height="70"/>
<rect key="frame" x="0.0" y="152.5" width="355" height="70"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="pat-ec-i28">
@ -54,26 +54,26 @@
</view>
<prototypes>
<tableViewCell opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="none" indentationWidth="10" reuseIdentifier="InboundAccountCell" id="AeP-ID-ahM" customClass="InboundAccountCell" customModule="GME_Remit" customModuleProvider="target">
<rect key="frame" x="0.0" y="28" width="355" height="98"/>
<rect key="frame" x="0.0" y="28" width="355" height="96.5"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="AeP-ID-ahM" id="b9x-HH-nRS">
<rect key="frame" x="0.0" y="0.0" width="355" height="98"/>
<rect key="frame" x="0.0" y="0.0" width="355" height="96.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<view opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="AWu-nl-Eel">
<rect key="frame" x="5" y="5" width="345" height="88"/>
<rect key="frame" x="5" y="5" width="345" height="86.5"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillProportionally" spacing="7" translatesAutoresizingMaskIntoConstraints="NO" id="ebc-B5-3Fg">
<rect key="frame" x="80" y="10" width="151" height="68"/>
<rect key="frame" x="80" y="10" width="155" height="66.5"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Standard Chartered Korea(SC First)" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="yXe-nl-aiX">
<rect key="frame" x="0.0" y="0.0" width="151" height="41.5"/>
<rect key="frame" x="0.0" y="0.0" width="155" height="40.5"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Medium" family="San Francisco Display" pointSize="17"/>
<color key="textColor" name="ThemeText"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Bank Account" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="k0e-on-9Xi">
<rect key="frame" x="0.0" y="48.5" width="151" height="19.5"/>
<rect key="frame" x="0.0" y="47.5" width="155" height="19"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="16"/>
<color key="textColor" name="ThemeText"/>
<nil key="highlightedColor"/>
@ -81,7 +81,7 @@
</subviews>
</stackView>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="sc" translatesAutoresizingMaskIntoConstraints="NO" id="DUf-vD-36D">
<rect key="frame" x="20" y="31.5" width="40" height="25"/>
<rect key="frame" x="20" y="31" width="40" height="25"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="width" constant="40" id="Heg-As-5wJ"/>
@ -89,7 +89,7 @@
</constraints>
</imageView>
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="8by-vt-0xy">
<rect key="frame" x="275" y="29" width="65" height="30"/>
<rect key="frame" x="275" y="28.5" width="65" height="30"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="nrY-wI-eQM">
<rect key="frame" x="0.0" y="0.0" width="30" height="30"/>

13
GME Remit/Modules/ManageAccountsModules/InboundAccounts/User Interface/View/InboundAccountsViewController.swift

@ -27,6 +27,8 @@ class InboundAccountsViewController: UIViewController {
private let openPenneyTest = PublishSubject<PenneyTestRequest>()
private let refreshControl = UIRefreshControl()
// MARK: Computed Properties
private var accounts: [InboundAccount] = [] {
didSet {
@ -79,6 +81,13 @@ extension InboundAccountsViewController {
waitingImageView.tintColor = .themeRed
waitingImageView.image = #imageLiteral(resourceName: "ic_warning").withRenderingMode(UIImage.RenderingMode.alwaysTemplate)
let colorOption = [NSAttributedString.Key.foregroundColor : UIColor.themeWhite]
let title = NSAttributedString(string: "pull to refresh", attributes: colorOption)
tableView.refreshControl = refreshControl
refreshControl.attributedTitle = title
refreshControl.backgroundColor = .themeBlue
refreshControl.tintColor = .themeWhite
}
private func setUIBinding() {
@ -93,7 +102,8 @@ extension InboundAccountsViewController {
let input = InboundAccountsPresenter.Input(
viewWillAppear: viewWillAppear,
add: addButton.rx.tap.asDriverOnErrorJustComplete(),
pennyTest: openPenneyTest.asDriverOnErrorJustComplete()
pennyTest: openPenneyTest.asDriverOnErrorJustComplete(),
refresh: refreshControl.rx.controlEvent(.valueChanged).asDriverOnErrorJustComplete()
)
let output = presenter.transform(input: input)
@ -109,6 +119,7 @@ extension InboundAccountsViewController {
).disposed(by: disposeBag)
output.accounts.drive(onNext: {[weak self] in
self?.tableView.refreshControl?.endRefreshing()
self?.accounts = $0
}).disposed(by: disposeBag)
}

8
GME Remit/Modules/ManageAccountsModules/InboundAccounts/User Interface/Wireframe/InboundAccountsWireframe.swift

@ -31,11 +31,11 @@ extension InboundAccountsWireframe: InboundAccountsWireframeInput {
return viewController
}
func addAccount() {
AddInboundAccountWireframe().open(source: view)
func addAccount(delegate: InboundPennyTestSubmitDelegate?) {
AddInboundAccountWireframe().open(delegate: delegate, source: view)
}
func pennyTest(with model: PenneyTestRequest) {
InboundPennyTestSubmitWireframe().open(with: model, on: view)
func pennyTest(with model: PenneyTestRequest, delegate: InboundPennyTestSubmitDelegate?) {
InboundPennyTestSubmitWireframe().open(with: model, delegate: delegate, on: view)
}
}

4
GME Remit/Modules/ManageAccountsModules/InboundAccounts/User Interface/Wireframe/InboundAccountsWireframeInput.swift

@ -9,6 +9,6 @@
import Foundation
protocol InboundAccountsWireframeInput: WireframeInput {
func addAccount()
func pennyTest(with model: PenneyTestRequest)
func addAccount(delegate: InboundPennyTestSubmitDelegate?)
func pennyTest(with model: PenneyTestRequest, delegate: InboundPennyTestSubmitDelegate?)
}

2
GME Remit/Modules/ManageAccountsModules/TotalManageAccounts/User Interface/Presenter/TotalManageAccountsPresenter.swift

@ -50,7 +50,7 @@ class TotalManageAccountsPresenter: ViewModelType {
}).disposed(by: disposeBag)
input.addInboundAccount.drive(onNext: {[weak self] in
self?.wireframe?.openAddInbound(with: $0)
self?.wireframe?.openAddInbound(with: $0, delegate: nil)
}).disposed(by: disposeBag)
input.verifyAccount.drive(onNext: {[weak self] in

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

@ -34,12 +34,12 @@ extension TotalManageAccountsWireframe: TotalManageAccountsWireframeInput {
AddAccountWireframe().openPushMainView(with: model, source: view)
}
func openAddInbound(with model: PenneyTestRequest?) {
AddInboundAccountWireframe().open(with: model, source: view)
func openAddInbound(with model: PenneyTestRequest?, delegate: InboundPennyTestSubmitDelegate?) {
AddInboundAccountWireframe().open(with: model, delegate: delegate, source: view)
}
func openVerify(with model: PenneyTestRequest) {
InboundPennyTestSubmitWireframe().open(with: model, on: view)
InboundPennyTestSubmitWireframe().open(with: model, delegate: nil, on: view)
}
func openRefreshToken(header: [KftcHeader]?, url: String?) {

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

@ -10,7 +10,7 @@ import Foundation
protocol TotalManageAccountsWireframeInput: WireframeInput {
func openAddAutodebit(with model: KFTCModel?)
func openAddInbound(with model: PenneyTestRequest?)
func openAddInbound(with model: PenneyTestRequest?, delegate: InboundPennyTestSubmitDelegate?)
func openVerify(with model: PenneyTestRequest)
func openRefreshToken(header: [KftcHeader]?, url: String?)
}

11
GME Remit/Modules/PowerCallModules/RechargeHistory/User Interface/Presenter/RechargeHistoryPresenter.swift

@ -18,13 +18,14 @@ class RechargeHistoryPresenter: ViewModelType {
let searchText: Driver<String>
let calandarTap: Driver<Void>
let periodCloseTap: Driver<Void>
let refresh: Driver<Void>
}
struct Output {
let isError: Driver<Error>
let isProgress: Driver<Bool>
let histories: Driver<[RechargeHistory]>
let fromTo: Driver<(String, String)>
let fromTo: Driver<(String, String)?>
}
private let disposeBag = DisposeBag()
@ -52,7 +53,7 @@ class RechargeHistoryPresenter: ViewModelType {
self?.interactor?.fetchFilteredHistory(search: $0)
}).disposed(by: disposeBag)
let fromTo = PublishSubject<(String, String)>()
let fromTo = BehaviorSubject<(String, String)?>(value: nil)
input.calandarTap.drive(onNext: { [weak self] in
self?.wireframe?.view.presentDatePicker { (from, to) in
guard
@ -66,6 +67,12 @@ class RechargeHistoryPresenter: ViewModelType {
}
}).disposed(by: disposeBag)
input.refresh.withLatestFrom(fromTo.asDriverOnErrorJustComplete()) {$1}
.drive(onNext: {[weak self] in
self?.progressLinker.onNext(true)
self?.interactor?.fetchHistory(from: $0?.0 ?? "", to: $0?.1 ?? "")
}).disposed(by: disposeBag)
return Output(
isError: errorLinker.asDriverOnErrorJustComplete(),
isProgress: progressLinker.asDriverOnErrorJustComplete(),

21
GME Remit/Modules/PowerCallModules/RechargeHistory/User Interface/View/RechargeHistoryViewController.swift

@ -16,6 +16,9 @@ class RechargeHistoryViewController: UIViewController {
var presenter: RechargeHistoryPresenter!
private let disposeBag = DisposeBag()
private let refreshControl = UIRefreshControl()
// MARK: Computed Properties
// MARK: IBOutlets
@ -83,6 +86,13 @@ extension RechargeHistoryViewController {
waitingInfoLabel.text = "waiting_uppercase_text".localized()
rechargedInfoLabel.text = "success_uppercase_text".localized()
canceledInfoLabel.text = "failure_uppercase_text".localized()
let colorOption = [NSAttributedString.Key.foregroundColor : UIColor.themeWhite]
let title = NSAttributedString(string: "pull to refresh", attributes: colorOption)
tableView.refreshControl = refreshControl
refreshControl.attributedTitle = title
refreshControl.backgroundColor = .themeBlue
refreshControl.tintColor = .themeWhite
}
private func setUIBinding() {
@ -101,7 +111,8 @@ extension RechargeHistoryViewController {
viewWillAppear: viewWillAppear,
searchText: searchBar.rx.text.orEmpty.asDriver(),
calandarTap: calandarButton.rx.tap.asDriverOnErrorJustComplete(),
periodCloseTap: periodViewCloseButton.rx.tap.asDriverOnErrorJustComplete()
periodCloseTap: periodViewCloseButton.rx.tap.asDriverOnErrorJustComplete(),
refresh: refreshControl.rx.controlEvent(.valueChanged).asDriverOnErrorJustComplete()
)
let output = presenter.transform(input: input)
@ -129,9 +140,11 @@ extension RechargeHistoryViewController {
.drive(errorLabel.rx.isHidden)
.disposed(by: disposeBag)
output.fromTo.map {$0.0}.drive(fromLabel.rx.text).disposed(by: disposeBag)
output.fromTo.map {$0.1}.drive(toLabel.rx.text).disposed(by: disposeBag)
output.fromTo.map {$0 == ("","")}.drive(periodView.rx.isAnimateHidden).disposed(by: disposeBag)
output.histories.map {_ in false}.drive(refreshControl.rx.isRefreshing).disposed(by: disposeBag)
output.fromTo.map {$0?.0}.drive(fromLabel.rx.text).disposed(by: disposeBag)
output.fromTo.map {$0?.1}.drive(toLabel.rx.text).disposed(by: disposeBag)
output.fromTo.map {$0 == nil }.drive(periodView.rx.isAnimateHidden).disposed(by: disposeBag)
}
}

1
GME Remit/Modules/RecipientModules/SetupRecipient/User Interface/View/ViewModel/SetupRecipientViewModel.swift

@ -378,6 +378,7 @@ extension SetupRecipientViewModel: SetupRecipientViewModelInterface {
case .bank:
guard let model = model as? SendMoneyBank else { return }
selectedBankLinker.onNext(model)
payoutPartner = model.payoutPartner
if model.branchRequired?.lowercased() == "true" {
selectedBranchLinker.onNext(nil)
}

2
GME Remit/Modules/RemittanceModules/InboundModules/AddInboundAccount/User Interface/View/AddInboundAccount.storyboard

@ -3,7 +3,7 @@
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15509"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15510"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>

10
GME Remit/Modules/RemittanceModules/InboundModules/AddInboundAccount/User Interface/Wireframe/AddInboundAccountWireframe.swift

@ -11,6 +11,7 @@ import UIKit
class AddInboundAccountWireframe {
weak var view: UIViewController!
private var selectedPenneyTestModel: PenneyTestRequest?
private var delegate: InboundPennyTestSubmitDelegate?
}
extension AddInboundAccountWireframe: AddInboundAccountWireframeInput {
@ -36,7 +37,12 @@ extension AddInboundAccountWireframe: AddInboundAccountWireframeInput {
return viewController
}
func open(with penneyTestModel: PenneyTestRequest? = nil, source on: UIViewController) {
func open(
with penneyTestModel: PenneyTestRequest? = nil,
delegate: InboundPennyTestSubmitDelegate?,
source on: UIViewController
) {
self.delegate = delegate
selectedPenneyTestModel = penneyTestModel
let vc = getMainView()
@ -48,6 +54,6 @@ extension AddInboundAccountWireframe: AddInboundAccountWireframeInput {
}
func goPenneyTest(with model: PenneyTestRequest) {
InboundPennyTestSubmitWireframe().push(with: model, on: view)
InboundPennyTestSubmitWireframe().push(with: model, delegate: delegate, on: view)
}
}

18
GME Remit/Modules/RemittanceModules/InboundModules/InboundPennyTestSubmit/User Interface/View/InboundPennyTestSubmitViewController.swift

@ -10,10 +10,16 @@ import UIKit
import RxSwift
import RxCocoa
protocol InboundPennyTestSubmitDelegate: class {
func didSuccess(_ viewController: UIViewController)
func didCancel(_ viewController: UIViewController)
}
class InboundPennyTestSubmitViewController: UIViewController {
// MARK: Properties
var presenter: InboundPennyTestSubmitPresenter!
weak var delegate: InboundPennyTestSubmitDelegate?
private let disposeBag = DisposeBag()
// MARK: Computed Properties
@ -54,7 +60,10 @@ class InboundPennyTestSubmitViewController: UIViewController {
// MARK: IBActions
@IBAction func touchClose(_ sender: UIBarButtonItem) {
dismiss(animated: true)
dismiss(animated: true) {[weak self] in
guard let `self` = self else { return }
self.delegate?.didCancel(self)
}
}
}
@ -116,8 +125,11 @@ extension InboundPennyTestSubmitViewController {
}).disposed(by: disposeBag)
output.success.drive(onNext: {[weak self] in
self?.alert(type: .success, message: "Added your inbound account", title: "Success") {
self?.dismiss(animated: true)
guard let `self` = self else { return }
self.alert(type: .success, message: "Added your inbound account", title: "Success") {
self.dismiss(animated: true) {
self.delegate?.didSuccess(self)
}
}
}).disposed(by: disposeBag)
}

18
GME Remit/Modules/RemittanceModules/InboundModules/InboundPennyTestSubmit/User Interface/Wireframe/InboundPennyTestSubmitWireframe.swift

@ -12,6 +12,7 @@ class InboundPennyTestSubmitWireframe {
weak var view: UIViewController!
private var model: PenneyTestRequest?
private var delegate: InboundPennyTestSubmitDelegate?
}
extension InboundPennyTestSubmitWireframe: InboundPennyTestSubmitWireframeInput {
@ -25,6 +26,7 @@ extension InboundPennyTestSubmitWireframe: InboundPennyTestSubmitWireframeInput
let viewController = viewControllerFromStoryboard(of: InboundPennyTestSubmitViewController.self)
viewController.presenter = presenter
viewController.delegate = delegate
interactor.output = presenter
presenter.interactor = interactor
@ -34,20 +36,30 @@ extension InboundPennyTestSubmitWireframe: InboundPennyTestSubmitWireframeInput
return viewController
}
func push(with model: PenneyTestRequest, on source: UIViewController) {
func push(
with model: PenneyTestRequest,
delegate: InboundPennyTestSubmitDelegate?,
on source: UIViewController
) {
self.model = model
self.delegate = delegate
let vc = getMainView()
source.navigationController?.pushViewController(vc, animated: false)
}
func open(with model: PenneyTestRequest, on source: UIViewController) {
func open(
with model: PenneyTestRequest,
delegate: InboundPennyTestSubmitDelegate?,
on source: UIViewController
) {
self.model = model
self.delegate = delegate
let vc = getMainView()
let naviVC = UINavigationController(rootViewController: vc)
naviVC.modalPresentationStyle = .overFullScreen
naviVC.modalTransitionStyle = .crossDissolve
naviVC.modalTransitionStyle = .coverVertical
source.present(naviVC, animated: true)
}

14
GME Remit/Modules/RemittanceModules/InboundModules/InboundReceipt/User Interface/Presenter/InboundReceiptPresenter.swift

@ -40,7 +40,8 @@ class InboundReceiptPresenter: ViewModelType {
input.register.withLatestFrom(model.asDriverOnErrorJustComplete()) {$1}
.drive(onNext: {[weak self] in
self?.wireframe?.openAddInboundAccount(with: $0)
guard let `self` = self else { return }
self.wireframe?.openAddInboundAccount(with: $0, delegate: self)
}).disposed(by: disposeBag)
return Output(
@ -68,3 +69,14 @@ extension InboundReceiptPresenter: InboundReceiptInteractorOutput {
errorLinker.onNext(error)
}
}
// MARK: InboundPennyTestSubmitDelegate
extension InboundReceiptPresenter: InboundPennyTestSubmitDelegate {
func didSuccess(_ viewController: UIViewController) {
wireframe?.pop()
}
func didCancel(_ viewController: UIViewController) {
// if canceled penny test verification.
}
}

13
GME Remit/Modules/RemittanceModules/InboundModules/InboundReceipt/User Interface/Wireframe/InboundReceiptWireframe.swift

@ -32,14 +32,17 @@ extension InboundReceiptWireframe: InboundReceiptWireframeInput {
return viewController
}
func push(with model: TransactionModel?, on source: UIViewController) {
func push(
with model: TransactionModel?,
on source: UIViewController
) {
self.model = model
let vc = getMainView()
source.navigationController?.pushViewController(vc, animated: true)
}
func openAddInboundAccount(with model: TransactionModel) {
func openAddInboundAccount(with model: TransactionModel, delegate: InboundPennyTestSubmitDelegate?) {
let bank = BankInformation(bankCode: model.inboundBankCode, bankName: model.inboundBankName)
let model = PenneyTestRequest(
@ -47,6 +50,10 @@ extension InboundReceiptWireframe: InboundReceiptWireframeInput {
account: model.inboundAccountNo ?? ""
)
AddInboundAccountWireframe().open(with: model, source: view)
AddInboundAccountWireframe().open(with: model, delegate: delegate, source: view)
}
func pop() {
view.navigationController?.popViewController(animated: true)
}
}

3
GME Remit/Modules/RemittanceModules/InboundModules/InboundReceipt/User Interface/Wireframe/InboundReceiptWireframeInput.swift

@ -9,5 +9,6 @@
import Foundation
protocol InboundReceiptWireframeInput: WireframeInput {
func openAddInboundAccount(with model: TransactionModel)
func openAddInboundAccount(with model: TransactionModel, delegate: InboundPennyTestSubmitDelegate?)
func pop()
}

75
GME Remit/Modules/RemittanceModules/TransactionHistoryModules/TransactionHistory/User Interface/View/TransactionHistory.storyboard

@ -3,7 +3,7 @@
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15509"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15510"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
@ -365,31 +365,59 @@
<stackView opaque="NO" contentMode="scaleToFill" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="Rah-XK-yIo">
<rect key="frame" x="16" y="43" width="343" height="35"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="W5a-gp-mdv">
<rect key="frame" x="0.0" y="0.0" width="164" height="35"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Medium" family="San Francisco Display" pointSize="16"/>
<color key="textColor" name="ThemeText"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="-" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="eFC-pC-p6h">
<rect key="frame" x="169" y="0.0" width="5.5" height="35"/>
<view clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="bqt-ku-7Pk">
<rect key="frame" x="0.0" y="0.0" width="343" height="35"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="ojY-3U-Rll">
<rect key="frame" x="108.5" y="-7.5" width="126" height="50"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gGX-qp-QKa">
<rect key="frame" x="0.0" y="0.0" width="50" height="50"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Medium" family="San Francisco Display" pointSize="16"/>
<color key="textColor" name="ThemeText"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="~" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="JKy-P9-m5l">
<rect key="frame" x="58" y="0.0" width="10" height="50"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Medium" family="San Francisco Display" pointSize="16"/>
<color key="textColor" name="ThemeText"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="h4N-LL-0cF">
<rect key="frame" x="76" y="0.0" width="50" height="50"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Medium" family="San Francisco Display" pointSize="16"/>
<color key="textColor" name="ThemeText"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="c1j-2H-GGN">
<rect key="frame" x="318" y="10" width="15" height="15"/>
<constraints>
<constraint firstAttribute="height" constant="15" id="3dV-fd-ozu"/>
<constraint firstAttribute="width" constant="15" id="dXL-cC-Mu2"/>
</constraints>
<state key="normal" title="Button" image="ic_error"/>
<connections>
<action selector="touchDateClose:" destination="GvJ-2t-mHS" eventType="touchUpInside" id="g2d-ge-WMo"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="width" constant="5.5" id="AYn-tF-Ijc"/>
<constraint firstItem="ojY-3U-Rll" firstAttribute="centerY" secondItem="bqt-ku-7Pk" secondAttribute="centerY" id="FOO-ws-lgK"/>
<constraint firstItem="c1j-2H-GGN" firstAttribute="centerY" secondItem="bqt-ku-7Pk" secondAttribute="centerY" id="HQL-49-UtA"/>
<constraint firstItem="ojY-3U-Rll" firstAttribute="centerX" secondItem="bqt-ku-7Pk" secondAttribute="centerX" id="IZD-Zt-9pu"/>
<constraint firstAttribute="trailing" secondItem="c1j-2H-GGN" secondAttribute="trailing" constant="10" id="vH0-KA-ZAw"/>
</constraints>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Medium" family="San Francisco Display" pointSize="14"/>
<color key="textColor" name="ThemeText"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="AHn-8d-aGF">
<rect key="frame" x="179.5" y="0.0" width="163.5" height="35"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Medium" family="San Francisco Display" pointSize="16"/>
<color key="textColor" name="ThemeText"/>
<nil key="highlightedColor"/>
</label>
</view>
</subviews>
<constraints>
<constraint firstAttribute="trailing" secondItem="bqt-ku-7Pk" secondAttribute="trailing" id="Mki-Uj-Lgl"/>
<constraint firstAttribute="bottom" secondItem="bqt-ku-7Pk" secondAttribute="bottom" id="RXU-BA-rju"/>
<constraint firstAttribute="height" constant="35" id="hJN-CB-9IL"/>
<constraint firstItem="W5a-gp-mdv" firstAttribute="width" secondItem="AHn-8d-aGF" secondAttribute="width" id="oUq-E2-hOL"/>
<constraint firstItem="bqt-ku-7Pk" firstAttribute="leading" secondItem="Rah-XK-yIo" secondAttribute="leading" id="jCj-cj-2oy"/>
<constraint firstItem="bqt-ku-7Pk" firstAttribute="top" secondItem="Rah-XK-yIo" secondAttribute="top" id="oCP-qe-3EG"/>
</constraints>
</stackView>
</subviews>
@ -435,12 +463,12 @@
<connections>
<outlet property="dateRangeLabelHeightConstraint" destination="hJN-CB-9IL" id="whx-Hw-6dG"/>
<outlet property="emptyLabel" destination="jdu-hl-JUc" id="oZb-Js-EUL"/>
<outlet property="fromDateLabel" destination="W5a-gp-mdv" id="3j3-id-7Zc"/>
<outlet property="fromDateLabel" destination="gGX-qp-QKa" id="lUj-zE-5DZ"/>
<outlet property="searchBar" destination="V0x-Ca-ysB" id="Emj-aH-wDi"/>
<outlet property="segmentHeightConstraints" destination="tei-l3-h4f" id="u8O-Gy-ksy"/>
<outlet property="segmentedControl" destination="Nqp-Xe-KAa" id="xLd-qf-mMh"/>
<outlet property="tableView" destination="V5c-xg-UKz" id="FbE-4L-pJk"/>
<outlet property="toDateLabel" destination="AHn-8d-aGF" id="J3c-pf-B14"/>
<outlet property="toDateLabel" destination="h4N-LL-0cF" id="arM-pK-5pE"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="pCp-ps-wXp" userLabel="First Responder" sceneMemberID="firstResponder"/>
@ -450,6 +478,7 @@
</scenes>
<resources>
<image name="ic_calender" width="25" height="25"/>
<image name="ic_error" width="55" height="55"/>
<image name="right_arrow" width="128" height="128"/>
<namedColor name="ThemeMainBackground">
<color red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>

8
GME Remit/Modules/RemittanceModules/TransactionHistoryModules/TransactionHistory/User Interface/View/TransactionHistoryDatePicker.storyboard

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14868" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait" appearance="dark"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14824"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15510"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
@ -164,10 +164,10 @@
</scenes>
<resources>
<namedColor name="ThemeMainBackground">
<color red="0.14901960784313725" green="0.14901960784313725" blue="0.14901960784313725" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="ThemeText">
<color white="0.80256043313300773" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<color red="0.28999999165534973" green="0.28999999165534973" blue="0.28999999165534973" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
</resources>
</document>

35
GME Remit/Modules/RemittanceModules/TransactionHistoryModules/TransactionHistory/User Interface/View/TransactionHistoryViewController.swift

@ -39,16 +39,19 @@ class TransactionHistoryViewController: UIViewController {
@IBOutlet weak var toDateLabel: UILabel!
@IBOutlet weak var searchBar: UISearchBar!
@IBOutlet weak var segmentHeightConstraints: NSLayoutConstraint!
// MARK: Properties
var from: String?
var to: String?
var receiptType = ReceiptType.overseas
@IBOutlet weak var segmentHeightConstraints: NSLayoutConstraint!
private lazy var refreshControl = UIRefreshControl()
var transactions: [TransactionModel] = [] {
didSet {
tableView.refreshControl?.endRefreshing()
self.emptyLabel.isHidden = !transactions.isEmpty
self.tableView.reloadData()
guard let fromDate = from, let toDate = to else {
@ -104,6 +107,13 @@ class TransactionHistoryViewController: UIViewController {
}
// MARK: IBActions
@IBAction func touchDateClose(_ sender: UIButton) {
from = nil
to = nil
self.presenter?.fetchTransactionHistories(overseasType: overseasType, fromDate: nil, toDate: nil)
}
@IBAction func openSearchFilter(_ sender: UIButton) {
// open search filter
guard let viewController = UIStoryboard(name: "TransactionHistoryDatePicker", bundle: nil)
@ -162,7 +172,7 @@ class TransactionHistoryViewController: UIViewController {
// segmentedControl.setTitle("paid_text".localized(), forSegmentAt: 2)
segmentedControl.tintColor = .themeRed
addRefreshControl()
}
@objc func search(sender: UITextField) {
@ -175,6 +185,27 @@ class TransactionHistoryViewController: UIViewController {
self.tableView.dataSource = self
searchBar.delegate = self
}
private func addRefreshControl() {
let colorOption = [NSAttributedString.Key.foregroundColor : UIColor.themeWhite]
let title = NSAttributedString(string: "pull to refresh", attributes: colorOption)
refreshControl.attributedTitle = title
refreshControl.backgroundColor = .themeBlue
refreshControl.tintColor = .themeWhite
refreshControl.addTarget(self, action: #selector(refresh), for: .valueChanged)
tableView.refreshControl = refreshControl
}
@objc
private func refresh() {
self.dateRangeLabelHeightConstraint.constant = 0
searchBar.text?.removeAll()
presenter?.fetchTransactionHistories(overseasType: overseasType, fromDate: from, toDate: to)
}
}
// MARK: TransactionHistoryViewInterface

Loading…
Cancel
Save