gme_2
6 years ago
56 changed files with 1512 additions and 90 deletions
-
152GMERemittance.xcodeproj/project.pbxproj
-
2GMERemittance/Api/ApiServiceType.swift
-
4GMERemittance/AppDelegate.swift
-
BINGMERemittance/Assets.xcassets/.DS_Store
-
2GMERemittance/Info.plist
-
62GMERemittance/Model/TransactionModel.swift
-
3GMERemittance/Module/AddReciepient/Application Logic/Interactor/AddReciepientInteractor.swift
-
2GMERemittance/Module/Home/Module Interface/HomeModuleInterface.swift
-
4GMERemittance/Module/Home/User Interface/Presenter/HomePresenter.swift
-
2GMERemittance/Module/Home/User Interface/View/HomeViewController.swift
-
7GMERemittance/Module/Home/User Interface/Wireframe/HomeWireframe.swift
-
2GMERemittance/Module/Home/User Interface/Wireframe/HomeWireframeInput.swift
-
9GMERemittance/Module/Login/Application Logic/Interactor/LoginInteractor.swift
-
5GMERemittance/Module/Main/User Interface/View/MainViewController.swift
-
15GMERemittance/Module/New Group/Kyc/Application Logic/Interactor/KycInteractor.swift
-
1GMERemittance/Module/New Group/Kyc/Application Logic/Interactor/KycInteractorIO.swift
-
5GMERemittance/Module/New Group/Kyc/User Interface/Presenter/KycPresenter.swift
-
6GMERemittance/Module/New Group/Kyc/User Interface/Wireframe/KycWireframe.swift
-
2GMERemittance/Module/New Group/Kyc/User Interface/Wireframe/KycWireframeInput.swift
-
4GMERemittance/Module/New Group/kycForm1/User Interface/View/kycForm1.storyboard
-
36GMERemittance/Module/New Group/kycForm1/User Interface/View/kycForm1ViewController.swift
-
2GMERemittance/Module/New Group/kycForm2/User Interface/View/kycForm2.storyboard
-
24GMERemittance/Module/New Group/kycForm2/User Interface/View/kycForm2ViewController.swift
-
3GMERemittance/Module/New Group/kycForm3/User Interface/View/kycForm3ViewController.swift
-
22GMERemittance/Module/Register/Application Logic/Interactor/RegisterInteractor.swift
-
3GMERemittance/Module/SendMoney/SendMoneyExchangeRate/User Interface/View/SendMoneyExchangeRateViewController.swift
-
1GMERemittance/Module/SendMoney/SendMoneyReceipt/Module Interface/SendMoneyReceiptModuleInterface.swift
-
4GMERemittance/Module/SendMoney/SendMoneyReceipt/User Interface/Presenter/SendMoneyReceiptPresenter.swift
-
1GMERemittance/Module/SendMoney/SendMoneyReceipt/User Interface/View/SendMoneyReceipt.storyboard
-
39GMERemittance/Module/SendMoney/SendMoneyReceipt/User Interface/View/SendMoneyReceiptViewController.swift
-
13GMERemittance/Module/SendMoney/SendMoneyReceipt/User Interface/Wireframe/SendMoneyReceiptWireframe.swift
-
2GMERemittance/Module/SendMoney/SendMoneyReceipt/User Interface/Wireframe/SendMoneyReceiptWireframeInput.swift
-
2GMERemittance/Module/SendMoney/SendMoneyVerification/Application Logic/Interactor/SendMoneyVerificationInteractor.swift
-
5GMERemittance/Module/SplashScreen/User Interface/View/SplashScreenViewController.swift
-
51GMERemittance/Module/TransactionHistory/Application Logic/Interactor/TransactionHistoryInteractor.swift
-
16GMERemittance/Module/TransactionHistory/Application Logic/Interactor/TransactionHistoryInteractorIO.swift
-
18GMERemittance/Module/TransactionHistory/Application Logic/Service/TransactionHistoryService.swift
-
36GMERemittance/Module/TransactionHistory/Application Logic/Service/TransactionHistoryServiceType.swift
-
15GMERemittance/Module/TransactionHistory/Module Interface/TransactionHistoryModuleInterface.swift
-
86GMERemittance/Module/TransactionHistory/User Interface/Presenter/TransactionHistoryPresenter.swift
-
36GMERemittance/Module/TransactionHistory/User Interface/View/Cell/TransactionHistoryTableViewCell.swift
-
88GMERemittance/Module/TransactionHistory/User Interface/View/DatePickerViewController.swift
-
261GMERemittance/Module/TransactionHistory/User Interface/View/TransactionHistory.storyboard
-
157GMERemittance/Module/TransactionHistory/User Interface/View/TransactionHistoryDatePicker.storyboard
-
218GMERemittance/Module/TransactionHistory/User Interface/View/TransactionHistoryViewController.swift
-
14GMERemittance/Module/TransactionHistory/User Interface/View/TransactionHistoryViewInterface.swift
-
43GMERemittance/Module/TransactionHistory/User Interface/Wireframe/TransactionHistoryWireframe.swift
-
13GMERemittance/Module/TransactionHistory/User Interface/Wireframe/TransactionHistoryWireframeInput.swift
-
2GMERemittance/TrackTransfer/TrackTransfer.storyboard
-
34GMERemittance/TrackTransfer/Transaction.swift
-
4GMERemittance/Transaction/TransactionStatement.storyboard
-
3GMERemittance/Transaction/TranscationTableViewCell.swift
-
19GMERemittance/UrlManager.swift
-
11GMERemittance/Utility/AppConstants.swift
-
8GMERemittance/_Home/_Home.storyboard
-
23GMERemittance/_Home/_HomeViewController.swift
@ -0,0 +1,62 @@ |
|||||
|
// |
||||
|
// TransactionModel.swift |
||||
|
// GMERemittance |
||||
|
// |
||||
|
// Created by gme_2 on 28/09/2018. |
||||
|
// Copyright © 2018 Gobal Money Express Co. Ltd. All rights reserved. |
||||
|
// |
||||
|
|
||||
|
import Foundation |
||||
|
import ObjectMapper |
||||
|
|
||||
|
|
||||
|
class TransactionModelContainer: Mappable { |
||||
|
var errorCode: String? |
||||
|
var message: String? |
||||
|
var id: String? |
||||
|
var data: [TransactionModel]? |
||||
|
|
||||
|
required init?(map: Map) { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
func mapping(map: Map) { |
||||
|
errorCode <- map["ErrorCode"] |
||||
|
message <- map["Msg"] |
||||
|
id <- map["Id"] |
||||
|
data <- map["Data"] |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
class TransactionModel: Mappable { |
||||
|
|
||||
|
var user: String? |
||||
|
var transactionId: String? |
||||
|
var controlNumber: String? |
||||
|
var pAmt: String? |
||||
|
var pCurrency: String? |
||||
|
var cCurrency: String? |
||||
|
var cAmt: String? |
||||
|
var payStatus: String? |
||||
|
var payOutMode: String? |
||||
|
var sendDate: String? |
||||
|
var paidDate: String? |
||||
|
|
||||
|
required init?(map: Map) { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
func mapping(map: Map) { |
||||
|
user <- map["User"] |
||||
|
transactionId <- map["TranId"] |
||||
|
controlNumber <- map["ControlNo"] |
||||
|
pAmt <- map["PayoutAmt"] |
||||
|
pCurrency <- map["PCurr"] |
||||
|
cAmt <- map["CollAmt"] |
||||
|
cCurrency <- map["CollCurr"] |
||||
|
payStatus <- map["PayStatus"] |
||||
|
payOutMode <- map["PayoutMode"] |
||||
|
sendDate <- map["SendDate"] |
||||
|
paidDate <- map["PaidDate"] |
||||
|
} |
||||
|
} |
@ -0,0 +1,51 @@ |
|||||
|
// |
||||
|
// TransactionHistoryInteractor.swift |
||||
|
// GMERemittance |
||||
|
// |
||||
|
// Created by gme_2 on 28/09/2018. |
||||
|
//Copyright © 2018 Gobal Money Express Co. Ltd. All rights reserved. |
||||
|
// |
||||
|
|
||||
|
import Foundation |
||||
|
|
||||
|
class TransactionHistoryInteractor { |
||||
|
|
||||
|
// MARK: Properties |
||||
|
|
||||
|
weak var output: TransactionHistoryInteractorOutput? |
||||
|
private let service: TransactionHistoryServiceType |
||||
|
|
||||
|
// MARK: Initialization |
||||
|
|
||||
|
init(service: TransactionHistoryServiceType) { |
||||
|
self.service = service |
||||
|
} |
||||
|
|
||||
|
// MARK: Converting entities |
||||
|
} |
||||
|
|
||||
|
// MARK: TransactionHistory interactor input interface |
||||
|
|
||||
|
extension TransactionHistoryInteractor: TransactionHistoryInteractorInput { |
||||
|
|
||||
|
func fetchTransactionHistories(fromDate: String?, toDate: String?) { |
||||
|
let userName = Utility.getMyUserName() |
||||
|
|
||||
|
var param: [String: String] = [:] |
||||
|
|
||||
|
if let from = fromDate { |
||||
|
param["FromDate"] = from |
||||
|
} |
||||
|
|
||||
|
if let to = toDate { |
||||
|
param["ToDate"] = to |
||||
|
} |
||||
|
|
||||
|
let parameters = (param.isEmpty ?? true) ? nil : param |
||||
|
self.service.fetchTransactionHistories(user: userName, param: parameters, success: { (model) in |
||||
|
self.output?.show(models: model) |
||||
|
}) { (error) in |
||||
|
self.output?.show(error: error) |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,16 @@ |
|||||
|
// |
||||
|
// TransactionHistoryInteractorIO.swift |
||||
|
// GMERemittance |
||||
|
// |
||||
|
// Created by gme_2 on 28/09/2018. |
||||
|
//Copyright © 2018 Gobal Money Express Co. Ltd. All rights reserved. |
||||
|
// |
||||
|
|
||||
|
protocol TransactionHistoryInteractorInput: class { |
||||
|
func fetchTransactionHistories(fromDate: String?, toDate: String?) |
||||
|
} |
||||
|
|
||||
|
protocol TransactionHistoryInteractorOutput: class { |
||||
|
func show(error: Error) |
||||
|
func show(models: [TransactionModel]) |
||||
|
} |
@ -0,0 +1,18 @@ |
|||||
|
// |
||||
|
// TransactionHistoryService.swift |
||||
|
// GMERemittance |
||||
|
// |
||||
|
// Created by gme_2 on 28/09/2018. |
||||
|
//Copyright © 2018 Gobal Money Express Co. Ltd. All rights reserved. |
||||
|
// |
||||
|
|
||||
|
import Foundation |
||||
|
|
||||
|
class TransactionHistoryService: TransactionHistoryServiceType { |
||||
|
|
||||
|
// MARK: Properties |
||||
|
|
||||
|
// MARK: Initialization |
||||
|
|
||||
|
// MARK: Data management |
||||
|
} |
@ -0,0 +1,36 @@ |
|||||
|
// |
||||
|
// TransactionHistoryServiceType.swift |
||||
|
// GMERemittance |
||||
|
// |
||||
|
// Created by gme_2 on 28/09/2018. |
||||
|
//Copyright © 2018 Gobal Money Express Co. Ltd. All rights reserved. |
||||
|
// |
||||
|
|
||||
|
import Foundation |
||||
|
|
||||
|
protocol TransactionHistoryServiceType: class, FetchTransactionHistoryService { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
protocol FetchTransactionHistoryService: ApiServiceType { |
||||
|
func fetchTransactionHistories(user: String, param: [String: String]?, success: @escaping (([TransactionModel]) -> ()), failure: @escaping ((Error) -> ())) |
||||
|
} |
||||
|
|
||||
|
extension FetchTransactionHistoryService { |
||||
|
func fetchTransactionHistories(user: String, param: [String: String]?, success: @escaping (([TransactionModel]) -> ()), failure: @escaping ((Error) -> ())) { |
||||
|
let url = baseUrl + "mobile/tranhistory/" + "\(user)" |
||||
|
self.auth.request(method: .post, url: url, params: param, success: { (response: TransactionModelContainer) in |
||||
|
if (response.errorCode ?? "") == "1" { |
||||
|
let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) |
||||
|
failure(error) |
||||
|
}else { |
||||
|
let model = response.data |
||||
|
success(model ?? []) |
||||
|
} |
||||
|
|
||||
|
}) { (error) in |
||||
|
failure(error) |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,15 @@ |
|||||
|
// |
||||
|
// TransactionHistoryModuleInterface.swift |
||||
|
// GMERemittance |
||||
|
// |
||||
|
// Created by gme_2 on 28/09/2018. |
||||
|
//Copyright © 2018 Gobal Money Express Co. Ltd. All rights reserved. |
||||
|
// |
||||
|
|
||||
|
protocol TransactionHistoryModuleInterface: class { |
||||
|
func viewIsReady() |
||||
|
func showDetailOf(index: Int) |
||||
|
func search(text: String) |
||||
|
func filterTransaction(type: TransactionModelType) |
||||
|
func fetchTransactionHistories(fromDate: String?, toDate: String?) |
||||
|
} |
@ -0,0 +1,86 @@ |
|||||
|
// |
||||
|
// TransactionHistoryPresenter.swift |
||||
|
// GMERemittance |
||||
|
// |
||||
|
// Created by gme_2 on 28/09/2018. |
||||
|
//Copyright © 2018 Gobal Money Express Co. Ltd. All rights reserved. |
||||
|
// |
||||
|
|
||||
|
import Foundation |
||||
|
|
||||
|
class TransactionHistoryPresenter { |
||||
|
|
||||
|
// MARK: Properties |
||||
|
|
||||
|
var models: [TransactionModel] = [] |
||||
|
var filteredModels: [TransactionModel] = [] { |
||||
|
didSet { |
||||
|
self.view?.show(models: filteredModels) |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
weak var view: TransactionHistoryViewInterface? |
||||
|
var interactor: TransactionHistoryInteractorInput? |
||||
|
var wireframe: TransactionHistoryWireframeInput? |
||||
|
|
||||
|
// MARK: Converting entities |
||||
|
} |
||||
|
|
||||
|
// MARK: TransactionHistory module interface |
||||
|
|
||||
|
extension TransactionHistoryPresenter: TransactionHistoryModuleInterface { |
||||
|
func fetchTransactionHistories(fromDate: String?, toDate: String?) { |
||||
|
self.view?.showLoading() |
||||
|
interactor?.fetchTransactionHistories(fromDate: fromDate, toDate: toDate) |
||||
|
} |
||||
|
|
||||
|
func viewIsReady() { |
||||
|
self.fetchTransactionHistories(fromDate: nil, toDate: nil) |
||||
|
} |
||||
|
|
||||
|
func filterTransaction(type: TransactionModelType) { |
||||
|
switch type { |
||||
|
case .all: |
||||
|
self.filteredModels = models |
||||
|
case .paid: |
||||
|
self.filteredModels = models.filter({ |
||||
|
($0.payStatus ?? "" ) == type.rawValue |
||||
|
}) |
||||
|
case .received: |
||||
|
self.filteredModels = models.filter({ |
||||
|
($0.payStatus ?? "" ) != TransactionModelType.paid.rawValue |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
func showDetailOf(index: Int) { |
||||
|
let element = self.models.elementAt(index: index) |
||||
|
guard let id = element?.transactionId else {return} |
||||
|
wireframe?.openReciept(transactionId: id) |
||||
|
} |
||||
|
|
||||
|
func search(text: String) { |
||||
|
let searchText = text.lowercased() |
||||
|
self.filteredModels = (models).filter({ |
||||
|
model in |
||||
|
return searchText.isEmpty || (model.user ?? "").lowercased().contains(searchText) |
||||
|
}).sorted(by: { (model, _) -> Bool in |
||||
|
return (model.user ?? "").hasPrefix(searchText) |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
// MARK: TransactionHistory interactor output interface |
||||
|
|
||||
|
extension TransactionHistoryPresenter: TransactionHistoryInteractorOutput { |
||||
|
func show(error: Error) { |
||||
|
self.view?.hideLoading() |
||||
|
self.view?.show(error: error.localizedDescription) |
||||
|
} |
||||
|
|
||||
|
func show(models: [TransactionModel]) { |
||||
|
self.view?.hideLoading() |
||||
|
self.models = models |
||||
|
self.filteredModels = self.models |
||||
|
} |
||||
|
} |
@ -0,0 +1,36 @@ |
|||||
|
// |
||||
|
// TransactionHistoryTableViewCell.swift |
||||
|
// GMERemittance |
||||
|
// |
||||
|
// Created by gme_2 on 28/09/2018. |
||||
|
// Copyright © 2018 Gobal Money Express Co. Ltd. All rights reserved. |
||||
|
// |
||||
|
|
||||
|
import UIKit |
||||
|
|
||||
|
class TransactionHistoryTableViewCell: UITableViewCell { |
||||
|
|
||||
|
@IBOutlet weak var bgView: UIView! |
||||
|
@IBOutlet weak var dateLabel: UILabel! |
||||
|
@IBOutlet weak var amountLabel: UILabel! |
||||
|
@IBOutlet weak var paymentMethodLabel: UILabel! |
||||
|
@IBOutlet weak var nameLabel: UILabel! |
||||
|
@IBOutlet weak var transactionNumberLabel: UILabel! |
||||
|
|
||||
|
var model: TransactionModel? |
||||
|
|
||||
|
override func awakeFromNib() { |
||||
|
super.awakeFromNib() |
||||
|
// Initialization code |
||||
|
} |
||||
|
|
||||
|
|
||||
|
func setup() { |
||||
|
self.dateLabel.text = model?.sendDate |
||||
|
self.amountLabel.text = model?.pAmt |
||||
|
self.paymentMethodLabel.text = model?.payOutMode |
||||
|
self.nameLabel.text = model?.user |
||||
|
self.transactionNumberLabel.text = model?.controlNumber // or transactionId ?? I wonder. |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,88 @@ |
|||||
|
// |
||||
|
// DatePickerViewController.swift |
||||
|
// GMERemittance |
||||
|
// |
||||
|
// Created by gme_2 on 01/10/2018. |
||||
|
// Copyright © 2018 Gobal Money Express Co. Ltd. All rights reserved. |
||||
|
// |
||||
|
|
||||
|
import UIKit |
||||
|
|
||||
|
class DatePickerViewController: UIViewController { |
||||
|
@IBOutlet weak var fromTextfield: UITextField! |
||||
|
@IBOutlet weak var toTextfield: UITextField! |
||||
|
|
||||
|
var completion: ((_ from: String?, _ to: String?) -> ())? |
||||
|
|
||||
|
var fromDate: String? |
||||
|
var toDate: String? |
||||
|
|
||||
|
var _fromDate: Date? { |
||||
|
didSet { |
||||
|
self.toDatePicker.minimumDate = _fromDate |
||||
|
self.toDatePicker.maximumDate = Date() |
||||
|
} |
||||
|
} |
||||
|
var _toDate: Date? |
||||
|
|
||||
|
let fromDatePicker = UIDatePicker() |
||||
|
let toDatePicker = UIDatePicker() |
||||
|
|
||||
|
override func viewDidLoad() { |
||||
|
super.viewDidLoad() |
||||
|
self.setupToDatePicker() |
||||
|
self.setupFromDatePicker() |
||||
|
self.fromDatePicker.date = Date() |
||||
|
self.handleFromDatePicker(sender: fromDatePicker) |
||||
|
// Do any additional setup after loading the view. |
||||
|
} |
||||
|
|
||||
|
|
||||
|
// IBActions |
||||
|
@IBAction func cancel(_ sender: Any) { |
||||
|
self.view.endEditing(true) |
||||
|
self.dismiss(animated: true, completion: nil) |
||||
|
} |
||||
|
|
||||
|
@IBAction func searcg(_ sender: UIButton) { |
||||
|
self.view.endEditing(true) |
||||
|
self.dismiss(animated: true, completion: { |
||||
|
self.completion?(self.fromDate, self.toDate) |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
// private functions |
||||
|
private func setupFromDatePicker() { |
||||
|
self.fromDatePicker.datePickerMode = .date |
||||
|
self.fromTextfield.inputView = fromDatePicker |
||||
|
fromDatePicker.maximumDate = Date() |
||||
|
self.fromDatePicker.addTarget(self, action: #selector(handleFromDatePicker(sender:)), for: .valueChanged) |
||||
|
} |
||||
|
|
||||
|
@objc private func handleFromDatePicker(sender: UIDatePicker) { |
||||
|
self._fromDate = sender.date |
||||
|
let dateFormatter = DateFormatter() |
||||
|
dateFormatter.dateFormat = AppConstants.dateFormat |
||||
|
let date = dateFormatter.string(from: sender.date) |
||||
|
self.fromTextfield.text = date |
||||
|
self.fromDate = date |
||||
|
} |
||||
|
|
||||
|
private func setupToDatePicker() { |
||||
|
self.toDatePicker.datePickerMode = .date |
||||
|
self.toTextfield.inputView = toDatePicker |
||||
|
toDatePicker.maximumDate = self._fromDate |
||||
|
self.toDatePicker.addTarget(self, action: #selector(handleToDatePicker(sender:)), for: .valueChanged) |
||||
|
} |
||||
|
|
||||
|
@objc private func handleToDatePicker(sender: UIDatePicker) { |
||||
|
self._toDate = sender.date |
||||
|
let dateFormatter = DateFormatter() |
||||
|
dateFormatter.dateFormat = AppConstants.dateFormat |
||||
|
let date = dateFormatter.string(from: sender.date) |
||||
|
self.toTextfield.text = date |
||||
|
self.toDate = date |
||||
|
} |
||||
|
} |
@ -0,0 +1,261 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES"> |
||||
|
<device id="retina4_7" orientation="portrait"> |
||||
|
<adaptation id="fullscreen"/> |
||||
|
</device> |
||||
|
<dependencies> |
||||
|
<deployment identifier="iOS"/> |
||||
|
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/> |
||||
|
<capability name="Safe area layout guides" minToolsVersion="9.0"/> |
||||
|
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> |
||||
|
</dependencies> |
||||
|
<customFonts key="customFonts"> |
||||
|
<array key="SanFranciscoDisplay-Medium.otf"> |
||||
|
<string>SanFranciscoDisplay-Medium</string> |
||||
|
</array> |
||||
|
<array key="SanFranciscoDisplay-Regular.otf"> |
||||
|
<string>SanFranciscoDisplay-Regular</string> |
||||
|
</array> |
||||
|
</customFonts> |
||||
|
<scenes> |
||||
|
<!--Transaction History View Controller--> |
||||
|
<scene sceneID="iJh-Id-NRj"> |
||||
|
<objects> |
||||
|
<viewController storyboardIdentifier="TransactionHistoryViewController" id="GvJ-2t-mHS" customClass="TransactionHistoryViewController" customModule="GMERemittance" customModuleProvider="target" sceneMemberID="viewController"> |
||||
|
<view key="view" contentMode="scaleToFill" id="okN-00-TGZ"> |
||||
|
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/> |
||||
|
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> |
||||
|
<subviews> |
||||
|
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="lJa-Eg-GAR"> |
||||
|
<rect key="frame" x="0.0" y="20" width="375" height="647"/> |
||||
|
<subviews> |
||||
|
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="96J-o9-k7w"> |
||||
|
<rect key="frame" x="0.0" y="0.0" width="375" height="50"/> |
||||
|
<subviews> |
||||
|
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Search..." textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="Y2X-bs-0NT"> |
||||
|
<rect key="frame" x="15" y="6" width="311" height="30"/> |
||||
|
<color key="textColor" red="0.29019607843137252" green="0.29019607843137252" blue="0.29019607843137252" alpha="1" colorSpace="calibratedRGB"/> |
||||
|
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="14"/> |
||||
|
<textInputTraits key="textInputTraits"/> |
||||
|
</textField> |
||||
|
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="JqT-TG-Aud"> |
||||
|
<rect key="frame" x="341" y="10" width="24" height="22"/> |
||||
|
<constraints> |
||||
|
<constraint firstAttribute="width" constant="24" id="nX3-O3-DI5"/> |
||||
|
<constraint firstAttribute="height" constant="22" id="zsX-3M-5o5"/> |
||||
|
</constraints> |
||||
|
<state key="normal" image="ic_calender"/> |
||||
|
<connections> |
||||
|
<action selector="openSearchFilter:" destination="GvJ-2t-mHS" eventType="touchUpInside" id="FZs-TO-ZeK"/> |
||||
|
</connections> |
||||
|
</button> |
||||
|
</subviews> |
||||
|
<color key="backgroundColor" red="0.97647058819999999" green="0.97647058819999999" blue="0.97647058819999999" alpha="1" colorSpace="calibratedRGB"/> |
||||
|
<constraints> |
||||
|
<constraint firstAttribute="trailing" secondItem="JqT-TG-Aud" secondAttribute="trailing" constant="10" id="2AF-eX-7SF"/> |
||||
|
<constraint firstItem="JqT-TG-Aud" firstAttribute="top" secondItem="96J-o9-k7w" secondAttribute="top" constant="10" id="ASS-yS-X7U"/> |
||||
|
<constraint firstAttribute="height" constant="50" id="diQ-UJ-UOv"/> |
||||
|
<constraint firstItem="JqT-TG-Aud" firstAttribute="leading" secondItem="Y2X-bs-0NT" secondAttribute="trailing" constant="15" id="fNs-fn-Erq"/> |
||||
|
<constraint firstItem="Y2X-bs-0NT" firstAttribute="centerY" secondItem="JqT-TG-Aud" secondAttribute="centerY" id="oxC-p9-gXb"/> |
||||
|
<constraint firstItem="Y2X-bs-0NT" firstAttribute="leading" secondItem="96J-o9-k7w" secondAttribute="leading" constant="15" id="per-7D-FsR"/> |
||||
|
</constraints> |
||||
|
</view> |
||||
|
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Lab-Ej-i1M"> |
||||
|
<rect key="frame" x="0.0" y="48" width="375" height="599"/> |
||||
|
<subviews> |
||||
|
<segmentedControl opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="top" segmentControlStyle="plain" selectedSegmentIndex="0" translatesAutoresizingMaskIntoConstraints="NO" id="Nqp-Xe-KAa"> |
||||
|
<rect key="frame" x="16" y="14" width="343" height="30"/> |
||||
|
<constraints> |
||||
|
<constraint firstAttribute="height" constant="29" id="tei-l3-h4f"/> |
||||
|
</constraints> |
||||
|
<segments> |
||||
|
<segment title="All"/> |
||||
|
<segment title="Sent"/> |
||||
|
<segment title="Delivered"/> |
||||
|
</segments> |
||||
|
<color key="tintColor" red="0.92549019610000005" green="0.10980392160000001" blue="0.14117647059999999" alpha="1" colorSpace="calibratedRGB"/> |
||||
|
<connections> |
||||
|
<action selector="segmentChanged:" destination="GvJ-2t-mHS" eventType="valueChanged" id="cYL-Zr-Bqg"/> |
||||
|
</connections> |
||||
|
</segmentedControl> |
||||
|
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="none" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="V5c-xg-UKz"> |
||||
|
<rect key="frame" x="10" y="83" width="355" height="516"/> |
||||
|
<color key="backgroundColor" red="0.90588235289999997" green="0.92941176469999998" blue="0.94901960780000005" alpha="1" colorSpace="calibratedRGB"/> |
||||
|
<prototypes> |
||||
|
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="none" indentationWidth="10" reuseIdentifier="TransactionHistoryTableViewCell" rowHeight="86" id="Atv-Nn-ubf" customClass="TransactionHistoryTableViewCell" customModule="GMERemittance" customModuleProvider="target"> |
||||
|
<rect key="frame" x="0.0" y="28" width="355" height="86"/> |
||||
|
<autoresizingMask key="autoresizingMask"/> |
||||
|
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="Atv-Nn-ubf" id="ObJ-hd-ZFd"> |
||||
|
<rect key="frame" x="0.0" y="0.0" width="355" height="86"/> |
||||
|
<autoresizingMask key="autoresizingMask"/> |
||||
|
<subviews> |
||||
|
<view clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="bIG-Mk-oNb"> |
||||
|
<rect key="frame" x="5" y="5" width="345" height="76"/> |
||||
|
<subviews> |
||||
|
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" verticalCompressionResistancePriority="751" text="Tue, 19/12/2017" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="lTb-Co-nsv"> |
||||
|
<rect key="frame" x="20" y="8" width="77.5" height="14.5"/> |
||||
|
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="12"/> |
||||
|
<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="200" verticalCompressionResistancePriority="700" text="To: Dhan Singh Saud" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="p2g-GW-5Xg"> |
||||
|
<rect key="frame" x="20" y="30" width="226.5" height="13"/> |
||||
|
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Medium" family="San Francisco Display" pointSize="18"/> |
||||
|
<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" verticalCompressionResistancePriority="751" text="Cash Payment" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="nbJ-vS-KkN"> |
||||
|
<rect key="frame" x="20" y="53" width="74" height="14.5"/> |
||||
|
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="12"/> |
||||
|
<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="Amount" textAlignment="right" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Ouw-tA-MfC"> |
||||
|
<rect key="frame" x="292" y="8" width="41" height="14.5"/> |
||||
|
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="12"/> |
||||
|
<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" text="Transacton No. 10004015" textAlignment="right" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="oBB-nk-OGM"> |
||||
|
<rect key="frame" x="203.5" y="53" width="129.5" height="14.5"/> |
||||
|
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="12"/> |
||||
|
<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="255" verticalHuggingPriority="251" horizontalCompressionResistancePriority="755" text="-1,000,000" textAlignment="right" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Dow-0z-Sq7"> |
||||
|
<rect key="frame" x="251.5" y="26" width="81.5" height="21.5"/> |
||||
|
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Medium" family="San Francisco Display" pointSize="18"/> |
||||
|
<color key="textColor" red="0.92941176469999998" green="0.10980392160000001" blue="0.14117647059999999" alpha="1" colorSpace="calibratedRGB"/> |
||||
|
<nil key="highlightedColor"/> |
||||
|
</label> |
||||
|
</subviews> |
||||
|
<color key="backgroundColor" red="1" green="1" blue="1" alpha="0.84999999999999998" colorSpace="calibratedRGB"/> |
||||
|
<constraints> |
||||
|
<constraint firstItem="Dow-0z-Sq7" firstAttribute="centerY" secondItem="p2g-GW-5Xg" secondAttribute="centerY" id="5lZ-gY-o6B"/> |
||||
|
<constraint firstAttribute="trailing" secondItem="Dow-0z-Sq7" secondAttribute="trailing" constant="12" id="Bdw-rw-rSH"/> |
||||
|
<constraint firstItem="Ouw-tA-MfC" firstAttribute="centerY" secondItem="lTb-Co-nsv" secondAttribute="centerY" id="JqH-Z3-EeB"/> |
||||
|
<constraint firstItem="nbJ-vS-KkN" firstAttribute="leading" secondItem="bIG-Mk-oNb" secondAttribute="leading" constant="20" id="McN-gl-bEy"/> |
||||
|
<constraint firstAttribute="bottom" secondItem="oBB-nk-OGM" secondAttribute="bottom" constant="8.5" id="Mwr-xj-zbX"/> |
||||
|
<constraint firstItem="oBB-nk-OGM" firstAttribute="centerY" secondItem="nbJ-vS-KkN" secondAttribute="centerY" id="Prt-Y0-3AA"/> |
||||
|
<constraint firstItem="lTb-Co-nsv" firstAttribute="leading" secondItem="bIG-Mk-oNb" secondAttribute="leading" constant="20" id="Z54-TR-cJr"/> |
||||
|
<constraint firstItem="Dow-0z-Sq7" firstAttribute="leading" secondItem="p2g-GW-5Xg" secondAttribute="trailing" constant="5" id="ahj-nt-OED"/> |
||||
|
<constraint firstAttribute="bottom" secondItem="nbJ-vS-KkN" secondAttribute="bottom" constant="8.5" id="gG0-rO-dMM"/> |
||||
|
<constraint firstItem="nbJ-vS-KkN" firstAttribute="top" secondItem="p2g-GW-5Xg" secondAttribute="bottom" constant="10" id="kjc-zN-coF"/> |
||||
|
<constraint firstAttribute="trailing" secondItem="oBB-nk-OGM" secondAttribute="trailing" constant="12" id="mAv-Vf-M5p"/> |
||||
|
<constraint firstItem="p2g-GW-5Xg" firstAttribute="leading" secondItem="bIG-Mk-oNb" secondAttribute="leading" constant="20" id="o7I-ml-XlB"/> |
||||
|
<constraint firstAttribute="trailing" secondItem="Ouw-tA-MfC" secondAttribute="trailing" constant="12" id="vMD-kU-WcD"/> |
||||
|
<constraint firstItem="lTb-Co-nsv" firstAttribute="top" secondItem="bIG-Mk-oNb" secondAttribute="top" constant="8.5" id="wAP-nC-iG4"/> |
||||
|
<constraint firstItem="p2g-GW-5Xg" firstAttribute="top" secondItem="lTb-Co-nsv" secondAttribute="bottom" constant="8" id="wYa-nj-Syb"/> |
||||
|
</constraints> |
||||
|
<userDefinedRuntimeAttributes> |
||||
|
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius"> |
||||
|
<integer key="value" value="10"/> |
||||
|
</userDefinedRuntimeAttribute> |
||||
|
</userDefinedRuntimeAttributes> |
||||
|
</view> |
||||
|
</subviews> |
||||
|
<color key="backgroundColor" red="0.90588235289999997" green="0.92941176469999998" blue="0.94901960780000005" alpha="1" colorSpace="calibratedRGB"/> |
||||
|
<constraints> |
||||
|
<constraint firstAttribute="bottom" secondItem="bIG-Mk-oNb" secondAttribute="bottom" constant="5" id="FmX-CZ-b2f"/> |
||||
|
<constraint firstItem="bIG-Mk-oNb" firstAttribute="top" secondItem="ObJ-hd-ZFd" secondAttribute="top" constant="5" id="a21-JC-koI"/> |
||||
|
<constraint firstAttribute="trailing" secondItem="bIG-Mk-oNb" secondAttribute="trailing" constant="5" id="fz5-MX-a0d"/> |
||||
|
<constraint firstItem="bIG-Mk-oNb" firstAttribute="leading" secondItem="ObJ-hd-ZFd" secondAttribute="leading" constant="5" id="y7r-FB-l56"/> |
||||
|
</constraints> |
||||
|
</tableViewCellContentView> |
||||
|
<connections> |
||||
|
<outlet property="amountLabel" destination="Dow-0z-Sq7" id="VvU-oA-Byh"/> |
||||
|
<outlet property="bgView" destination="bIG-Mk-oNb" id="863-hd-Txp"/> |
||||
|
<outlet property="dateLabel" destination="lTb-Co-nsv" id="lHC-Tm-REr"/> |
||||
|
<outlet property="nameLabel" destination="p2g-GW-5Xg" id="tqe-cU-TkP"/> |
||||
|
<outlet property="paymentMethodLabel" destination="nbJ-vS-KkN" id="2ny-pt-u6Z"/> |
||||
|
<outlet property="transactionNumberLabel" destination="oBB-nk-OGM" id="q3t-3h-Xo0"/> |
||||
|
</connections> |
||||
|
</tableViewCell> |
||||
|
</prototypes> |
||||
|
</tableView> |
||||
|
<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" 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="-" 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"/> |
||||
|
<constraints> |
||||
|
<constraint firstAttribute="width" constant="5.5" id="AYn-tF-Ijc"/> |
||||
|
</constraints> |
||||
|
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Medium" family="San Francisco Display" pointSize="14"/> |
||||
|
<nil key="textColor"/> |
||||
|
<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" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="calibratedRGB"/> |
||||
|
<nil key="highlightedColor"/> |
||||
|
</label> |
||||
|
</subviews> |
||||
|
<constraints> |
||||
|
<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"/> |
||||
|
</constraints> |
||||
|
</stackView> |
||||
|
</subviews> |
||||
|
<color key="backgroundColor" red="0.90588235289999997" green="0.92941176469999998" blue="0.94901960780000005" alpha="1" colorSpace="calibratedRGB"/> |
||||
|
<constraints> |
||||
|
<constraint firstItem="V5c-xg-UKz" firstAttribute="leading" secondItem="Lab-Ej-i1M" secondAttribute="leading" constant="10" id="19B-2c-AKi"/> |
||||
|
<constraint firstItem="Rah-XK-yIo" firstAttribute="top" secondItem="Nqp-Xe-KAa" secondAttribute="bottom" id="Fi6-rY-lgc"/> |
||||
|
<constraint firstItem="Rah-XK-yIo" firstAttribute="trailing" secondItem="Nqp-Xe-KAa" secondAttribute="trailing" id="L6M-Gp-g7g"/> |
||||
|
<constraint firstAttribute="bottom" secondItem="V5c-xg-UKz" secondAttribute="bottom" id="bgE-O3-gDE"/> |
||||
|
<constraint firstAttribute="trailing" secondItem="Nqp-Xe-KAa" secondAttribute="trailing" constant="16" id="dJJ-PA-IBF"/> |
||||
|
<constraint firstItem="Rah-XK-yIo" firstAttribute="leading" secondItem="Nqp-Xe-KAa" secondAttribute="leading" id="meW-v8-DAo"/> |
||||
|
<constraint firstItem="Nqp-Xe-KAa" firstAttribute="top" secondItem="Lab-Ej-i1M" secondAttribute="top" constant="14" id="pRo-d7-cki"/> |
||||
|
<constraint firstItem="V5c-xg-UKz" firstAttribute="top" secondItem="Rah-XK-yIo" secondAttribute="bottom" constant="5" id="q7k-Xg-mTd"/> |
||||
|
<constraint firstAttribute="trailing" secondItem="V5c-xg-UKz" secondAttribute="trailing" constant="10" id="rnJ-w4-OL3"/> |
||||
|
<constraint firstItem="Nqp-Xe-KAa" firstAttribute="leading" secondItem="Lab-Ej-i1M" secondAttribute="leading" constant="16" id="voS-P3-7PY"/> |
||||
|
</constraints> |
||||
|
</view> |
||||
|
</subviews> |
||||
|
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> |
||||
|
<constraints> |
||||
|
<constraint firstAttribute="trailing" secondItem="Lab-Ej-i1M" secondAttribute="trailing" id="52x-nW-Pbv"/> |
||||
|
<constraint firstAttribute="trailing" secondItem="96J-o9-k7w" secondAttribute="trailing" id="Hab-wU-P4e"/> |
||||
|
<constraint firstItem="96J-o9-k7w" firstAttribute="top" secondItem="lJa-Eg-GAR" secondAttribute="top" id="IOY-z0-Jlv"/> |
||||
|
<constraint firstItem="Lab-Ej-i1M" firstAttribute="leading" secondItem="lJa-Eg-GAR" secondAttribute="leading" id="KdC-we-U6d"/> |
||||
|
<constraint firstItem="96J-o9-k7w" firstAttribute="leading" secondItem="lJa-Eg-GAR" secondAttribute="leading" id="QfN-VG-5Ch"/> |
||||
|
<constraint firstItem="Lab-Ej-i1M" firstAttribute="top" secondItem="96J-o9-k7w" secondAttribute="bottom" constant="-2" id="U6r-XM-Zzj"/> |
||||
|
<constraint firstAttribute="bottom" secondItem="Lab-Ej-i1M" secondAttribute="bottom" id="ngK-Su-wfA"/> |
||||
|
</constraints> |
||||
|
</view> |
||||
|
</subviews> |
||||
|
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> |
||||
|
<constraints> |
||||
|
<constraint firstItem="lJa-Eg-GAR" firstAttribute="trailing" secondItem="p2D-KN-s9L" secondAttribute="trailing" id="WXR-eI-zww"/> |
||||
|
<constraint firstItem="lJa-Eg-GAR" firstAttribute="leading" secondItem="p2D-KN-s9L" secondAttribute="leading" id="bHd-K7-gbE"/> |
||||
|
<constraint firstItem="lJa-Eg-GAR" firstAttribute="top" secondItem="p2D-KN-s9L" secondAttribute="top" id="vR8-Ls-hba"/> |
||||
|
<constraint firstItem="lJa-Eg-GAR" firstAttribute="bottom" secondItem="p2D-KN-s9L" secondAttribute="bottom" id="xVz-8x-JrH"/> |
||||
|
</constraints> |
||||
|
<viewLayoutGuide key="safeArea" id="p2D-KN-s9L"/> |
||||
|
</view> |
||||
|
<connections> |
||||
|
<outlet property="dateRangeLabelHeightConstraint" destination="hJN-CB-9IL" id="whx-Hw-6dG"/> |
||||
|
<outlet property="fromDateLabel" destination="W5a-gp-mdv" id="3j3-id-7Zc"/> |
||||
|
<outlet property="searchTextField" destination="Y2X-bs-0NT" id="Q9B-ie-seX"/> |
||||
|
<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"/> |
||||
|
</connections> |
||||
|
</viewController> |
||||
|
<placeholder placeholderIdentifier="IBFirstResponder" id="pCp-ps-wXp" userLabel="First Responder" sceneMemberID="firstResponder"/> |
||||
|
</objects> |
||||
|
<point key="canvasLocation" x="631" y="76"/> |
||||
|
</scene> |
||||
|
</scenes> |
||||
|
<resources> |
||||
|
<image name="ic_calender" width="25" height="25"/> |
||||
|
</resources> |
||||
|
<color key="tintColor" red="0.78177064659999995" green="0.55228364470000002" blue="0.018981300289999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
||||
|
</document> |
@ -0,0 +1,157 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> |
||||
|
<device id="retina4_7" orientation="portrait"> |
||||
|
<adaptation id="fullscreen"/> |
||||
|
</device> |
||||
|
<dependencies> |
||||
|
<deployment identifier="iOS"/> |
||||
|
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/> |
||||
|
<capability name="Safe area layout guides" minToolsVersion="9.0"/> |
||||
|
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> |
||||
|
</dependencies> |
||||
|
<customFonts key="customFonts"> |
||||
|
<array key="SanFranciscoDisplay-Regular.otf"> |
||||
|
<string>SanFranciscoDisplay-Regular</string> |
||||
|
</array> |
||||
|
<array key="SanFranciscoText-Regular.otf"> |
||||
|
<string>SanFranciscoText-Regular</string> |
||||
|
</array> |
||||
|
</customFonts> |
||||
|
<scenes> |
||||
|
<!--Date Picker View Controller--> |
||||
|
<scene sceneID="iYG-BI-6pQ"> |
||||
|
<objects> |
||||
|
<viewController storyboardIdentifier="DatePickerViewController" modalTransitionStyle="crossDissolve" modalPresentationStyle="overCurrentContext" id="d6i-cC-L4t" customClass="DatePickerViewController" customModule="GMERemittance" customModuleProvider="target" sceneMemberID="viewController"> |
||||
|
<view key="view" contentMode="scaleToFill" id="bQE-Xw-KV7"> |
||||
|
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/> |
||||
|
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> |
||||
|
<subviews> |
||||
|
<view clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ULD-Eu-tB1"> |
||||
|
<rect key="frame" x="16" y="212" width="343" height="243"/> |
||||
|
<subviews> |
||||
|
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="From" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="egs-MP-XU0"> |
||||
|
<rect key="frame" x="16" y="25" width="33" height="17"/> |
||||
|
<fontDescription key="fontDescription" type="system" pointSize="14"/> |
||||
|
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="calibratedRGB"/> |
||||
|
<nil key="highlightedColor"/> |
||||
|
</label> |
||||
|
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Select start date" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="pCR-cq-obj"> |
||||
|
<rect key="frame" x="16" y="53" width="308" height="43"/> |
||||
|
<constraints> |
||||
|
<constraint firstAttribute="height" constant="43" id="Dk4-ZC-Ey4"/> |
||||
|
</constraints> |
||||
|
<color key="textColor" red="0.29019607843137252" green="0.29019607843137252" blue="0.29019607843137252" alpha="1" colorSpace="calibratedRGB"/> |
||||
|
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="17"/> |
||||
|
<textInputTraits key="textInputTraits"/> |
||||
|
</textField> |
||||
|
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="To" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="8R4-ao-hRh"> |
||||
|
<rect key="frame" x="16" y="107" width="15.5" height="17"/> |
||||
|
<fontDescription key="fontDescription" type="system" pointSize="14"/> |
||||
|
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="calibratedRGB"/> |
||||
|
<nil key="highlightedColor"/> |
||||
|
</label> |
||||
|
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Select end date" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="I48-21-OzR"> |
||||
|
<rect key="frame" x="16" y="135" width="308" height="43"/> |
||||
|
<constraints> |
||||
|
<constraint firstAttribute="height" constant="43" id="3EU-b3-51N"/> |
||||
|
</constraints> |
||||
|
<color key="textColor" red="0.29019607843137252" green="0.29019607843137252" blue="0.29019607843137252" alpha="1" colorSpace="calibratedRGB"/> |
||||
|
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="17"/> |
||||
|
<textInputTraits key="textInputTraits"/> |
||||
|
</textField> |
||||
|
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="nPo-RO-gkQ"> |
||||
|
<rect key="frame" x="0.0" y="200" width="343" height="1"/> |
||||
|
<color key="backgroundColor" red="0.7843137255" green="0.78039215689999997" blue="0.80000000000000004" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
||||
|
<constraints> |
||||
|
<constraint firstAttribute="height" constant="1" id="e5f-OB-PCo"/> |
||||
|
</constraints> |
||||
|
</view> |
||||
|
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="aSy-Xt-xYB"> |
||||
|
<rect key="frame" x="0.0" y="201" width="343" height="42"/> |
||||
|
<subviews> |
||||
|
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" spacing="1" translatesAutoresizingMaskIntoConstraints="NO" id="bCn-Ov-est"> |
||||
|
<rect key="frame" x="0.0" y="0.0" width="343" height="42"/> |
||||
|
<subviews> |
||||
|
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="d6F-Zw-V5J"> |
||||
|
<rect key="frame" x="0.0" y="0.0" width="171" height="42"/> |
||||
|
<color key="backgroundColor" red="0.90980392160000001" green="0.90980392160000001" blue="0.90980392160000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
||||
|
<fontDescription key="fontDescription" name="SanFranciscoText-Regular" family="San Francisco Text" pointSize="17"/> |
||||
|
<state key="normal" title="Cancel"> |
||||
|
<color key="titleColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
||||
|
</state> |
||||
|
<connections> |
||||
|
<action selector="cancel:" destination="d6i-cC-L4t" eventType="touchUpInside" id="k5O-nR-fMk"/> |
||||
|
</connections> |
||||
|
</button> |
||||
|
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="rgV-Oy-aLC"> |
||||
|
<rect key="frame" x="172" y="0.0" width="171" height="42"/> |
||||
|
<color key="backgroundColor" red="0.90980392160000001" green="0.90980392160000001" blue="0.90980392160000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
||||
|
<fontDescription key="fontDescription" name="SanFranciscoText-Regular" family="San Francisco Text" pointSize="17"/> |
||||
|
<state key="normal" title="Search"> |
||||
|
<color key="titleColor" red="0.92549019610000005" green="0.10980392160000001" blue="0.14117647059999999" alpha="0.90000000000000002" colorSpace="calibratedRGB"/> |
||||
|
</state> |
||||
|
<connections> |
||||
|
<action selector="searcg:" destination="d6i-cC-L4t" eventType="touchUpInside" id="Dj2-nZ-Hs4"/> |
||||
|
</connections> |
||||
|
</button> |
||||
|
</subviews> |
||||
|
<color key="backgroundColor" red="0.90980392160000001" green="0.2705078125" blue="0.90980392160000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
||||
|
</stackView> |
||||
|
</subviews> |
||||
|
<color key="backgroundColor" red="0.7843137255" green="0.78039215689999997" blue="0.80000000000000004" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
||||
|
<constraints> |
||||
|
<constraint firstAttribute="bottom" secondItem="bCn-Ov-est" secondAttribute="bottom" id="0Sh-Ug-bQu"/> |
||||
|
<constraint firstItem="bCn-Ov-est" firstAttribute="leading" secondItem="aSy-Xt-xYB" secondAttribute="leading" id="5yT-pJ-H5B"/> |
||||
|
<constraint firstAttribute="trailing" secondItem="bCn-Ov-est" secondAttribute="trailing" id="RBp-Nm-PWi"/> |
||||
|
<constraint firstItem="bCn-Ov-est" firstAttribute="top" secondItem="aSy-Xt-xYB" secondAttribute="top" id="Zjm-uS-Jfa"/> |
||||
|
</constraints> |
||||
|
</view> |
||||
|
</subviews> |
||||
|
<color key="backgroundColor" red="0.90980392160000001" green="0.90980392160000001" blue="0.90980392160000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
||||
|
<constraints> |
||||
|
<constraint firstItem="8R4-ao-hRh" firstAttribute="leading" secondItem="ULD-Eu-tB1" secondAttribute="leading" constant="16" id="0LV-ar-87s"/> |
||||
|
<constraint firstItem="8R4-ao-hRh" firstAttribute="top" secondItem="pCR-cq-obj" secondAttribute="bottom" constant="11" id="0oF-Hk-lvr"/> |
||||
|
<constraint firstAttribute="trailing" secondItem="pCR-cq-obj" secondAttribute="trailing" constant="19" id="413-CZ-J8T"/> |
||||
|
<constraint firstAttribute="trailing" secondItem="nPo-RO-gkQ" secondAttribute="trailing" id="AFU-Hr-KmU"/> |
||||
|
<constraint firstAttribute="bottom" secondItem="aSy-Xt-xYB" secondAttribute="bottom" id="BTL-N4-Ozp"/> |
||||
|
<constraint firstItem="pCR-cq-obj" firstAttribute="leading" secondItem="ULD-Eu-tB1" secondAttribute="leading" constant="16" id="Eac-MA-GgN"/> |
||||
|
<constraint firstAttribute="trailing" secondItem="I48-21-OzR" secondAttribute="trailing" constant="19" id="FpV-8q-7uU"/> |
||||
|
<constraint firstItem="I48-21-OzR" firstAttribute="leading" secondItem="ULD-Eu-tB1" secondAttribute="leading" constant="16" id="KmQ-gF-QZu"/> |
||||
|
<constraint firstItem="aSy-Xt-xYB" firstAttribute="leading" secondItem="ULD-Eu-tB1" secondAttribute="leading" id="LVI-hw-VsL"/> |
||||
|
<constraint firstItem="egs-MP-XU0" firstAttribute="top" secondItem="ULD-Eu-tB1" secondAttribute="top" constant="25" id="OH4-Ni-ZY1"/> |
||||
|
<constraint firstItem="I48-21-OzR" firstAttribute="top" secondItem="8R4-ao-hRh" secondAttribute="bottom" constant="11" id="QPH-PK-huz"/> |
||||
|
<constraint firstItem="nPo-RO-gkQ" firstAttribute="leading" secondItem="ULD-Eu-tB1" secondAttribute="leading" id="SH3-Wr-k5R"/> |
||||
|
<constraint firstAttribute="height" constant="243" id="USC-vh-uuz"/> |
||||
|
<constraint firstItem="egs-MP-XU0" firstAttribute="leading" secondItem="ULD-Eu-tB1" secondAttribute="leading" constant="16" id="Z4f-ia-o2g"/> |
||||
|
<constraint firstItem="pCR-cq-obj" firstAttribute="top" secondItem="egs-MP-XU0" secondAttribute="bottom" constant="11" id="bl6-pu-TZF"/> |
||||
|
<constraint firstItem="aSy-Xt-xYB" firstAttribute="top" secondItem="nPo-RO-gkQ" secondAttribute="bottom" id="kXh-ad-lTJ"/> |
||||
|
<constraint firstAttribute="trailing" secondItem="aSy-Xt-xYB" secondAttribute="trailing" id="mQH-fh-PdD"/> |
||||
|
<constraint firstItem="nPo-RO-gkQ" firstAttribute="top" secondItem="I48-21-OzR" secondAttribute="bottom" constant="22" id="n5T-gB-JvY"/> |
||||
|
</constraints> |
||||
|
<userDefinedRuntimeAttributes> |
||||
|
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius"> |
||||
|
<integer key="value" value="10"/> |
||||
|
</userDefinedRuntimeAttribute> |
||||
|
</userDefinedRuntimeAttributes> |
||||
|
</view> |
||||
|
</subviews> |
||||
|
<color key="backgroundColor" white="0.29024367559523806" alpha="0.55325704225352113" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> |
||||
|
<gestureRecognizers/> |
||||
|
<constraints> |
||||
|
<constraint firstItem="ULD-Eu-tB1" firstAttribute="centerY" secondItem="bQE-Xw-KV7" secondAttribute="centerY" id="K3C-Xo-Dj4"/> |
||||
|
<constraint firstItem="OTz-yN-Foh" firstAttribute="trailing" secondItem="ULD-Eu-tB1" secondAttribute="trailing" constant="16" id="WWg-39-nhB"/> |
||||
|
<constraint firstItem="ULD-Eu-tB1" firstAttribute="leading" secondItem="OTz-yN-Foh" secondAttribute="leading" constant="16" id="zgz-ev-N5r"/> |
||||
|
</constraints> |
||||
|
<viewLayoutGuide key="safeArea" id="OTz-yN-Foh"/> |
||||
|
</view> |
||||
|
<connections> |
||||
|
<outlet property="fromTextfield" destination="pCR-cq-obj" id="rgN-1c-pJb"/> |
||||
|
<outlet property="toTextfield" destination="I48-21-OzR" id="nBT-06-403"/> |
||||
|
</connections> |
||||
|
</viewController> |
||||
|
<placeholder placeholderIdentifier="IBFirstResponder" id="FmM-Wk-2zF" userLabel="First Responder" sceneMemberID="firstResponder"/> |
||||
|
</objects> |
||||
|
<point key="canvasLocation" x="7265" y="-236"/> |
||||
|
</scene> |
||||
|
</scenes> |
||||
|
</document> |
@ -0,0 +1,218 @@ |
|||||
|
// |
||||
|
// TransactionHistoryViewController.swift |
||||
|
// GMERemittance |
||||
|
// |
||||
|
// Created by gme_2 on 28/09/2018. |
||||
|
//Copyright © 2018 Gobal Money Express Co. Ltd. All rights reserved. |
||||
|
// |
||||
|
|
||||
|
import UIKit |
||||
|
|
||||
|
enum TransactionModelType: String { |
||||
|
case paid = "Paid" |
||||
|
case all = "all" |
||||
|
case received = "received" |
||||
|
} |
||||
|
|
||||
|
class TransactionHistoryViewController: UIViewController { |
||||
|
|
||||
|
enum SegmentIndex: Int { |
||||
|
case all = 0 |
||||
|
case sent |
||||
|
case delivered |
||||
|
} |
||||
|
|
||||
|
struct Constant { |
||||
|
static let heightOfDateRangeLabel: CGFloat = 35 |
||||
|
} |
||||
|
|
||||
|
@IBOutlet weak var fromDateLabel: UILabel! |
||||
|
@IBOutlet weak var toDateLabel: UILabel! |
||||
|
|
||||
|
// MARK: IBOutlets |
||||
|
@IBOutlet weak var tableView: UITableView! |
||||
|
@IBOutlet weak var segmentedControl: UISegmentedControl! |
||||
|
@IBOutlet weak var dateRangeLabelHeightConstraint: NSLayoutConstraint! |
||||
|
@IBOutlet weak var searchTextField: UITextField! |
||||
|
|
||||
|
|
||||
|
// MARK: Properties |
||||
|
|
||||
|
var from: String? |
||||
|
var to: String? |
||||
|
|
||||
|
var transactions: [TransactionModel] = [] { |
||||
|
didSet { |
||||
|
self.tableView.reloadData() |
||||
|
guard let fromDate = from, let toDate = to else { |
||||
|
self.dateRangeLabelHeightConstraint.constant = 0 |
||||
|
return |
||||
|
} |
||||
|
self.fromDateLabel.text = self.getHUmanReadableDate(date: fromDate) |
||||
|
self.toDateLabel.text = self.getHUmanReadableDate(date: toDate) |
||||
|
UIView.animate(withDuration: 0.33, animations: { |
||||
|
self.dateRangeLabelHeightConstraint.constant = Constant.heightOfDateRangeLabel |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
var transactionType: TransactionModelType? { |
||||
|
didSet { |
||||
|
// filter for transaction type |
||||
|
if self.transactionType != oldValue { |
||||
|
guard let type = self.transactionType else {return} |
||||
|
self.presenter?.filterTransaction(type: type) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
var presenter: TransactionHistoryModuleInterface? |
||||
|
|
||||
|
|
||||
|
// MARK: VC's Life cycle |
||||
|
|
||||
|
override func viewDidLoad() { |
||||
|
super.viewDidLoad() |
||||
|
self.setup() |
||||
|
presenter?.viewIsReady() |
||||
|
setupNavigation() |
||||
|
} |
||||
|
|
||||
|
override func viewWillAppear(_ animated: Bool) { |
||||
|
super.viewWillAppear(animated) |
||||
|
self.navigationItem.title = "Transaction History" |
||||
|
} |
||||
|
|
||||
|
override func viewWillDisappear(_ animated: Bool) { |
||||
|
super.viewWillAppear(animated) |
||||
|
self.navigationItem.title = "" |
||||
|
} |
||||
|
|
||||
|
// MARK: IBActions |
||||
|
@IBAction func openSearchFilter(_ sender: UIButton) { |
||||
|
// open search filter |
||||
|
let viewController = UIStoryboard.init(name: "TransactionHistoryDatePicker", bundle: nil).instantiateViewController(withIdentifier: "DatePickerViewController") as! DatePickerViewController |
||||
|
viewController.completion = self.selectedDate |
||||
|
self.present(viewController, animated: true, completion: nil) |
||||
|
} |
||||
|
|
||||
|
@IBAction func segmentChanged(_ sender: UISegmentedControl) { |
||||
|
guard let index = SegmentIndex(rawValue: sender.selectedSegmentIndex) else {return} |
||||
|
switch index { |
||||
|
case .all: |
||||
|
self.transactionType = .all |
||||
|
case .sent: |
||||
|
self.transactionType = .received |
||||
|
case .delivered: |
||||
|
self.transactionType = .paid |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
// MARK: Other Functions |
||||
|
|
||||
|
private func selectedDate(from: String?, to: String?) { |
||||
|
self.from = from |
||||
|
self.to = to |
||||
|
guard let fromDate = from, let toDate = to else {return} |
||||
|
self.presenter?.fetchTransactionHistories(fromDate: fromDate, toDate: toDate) |
||||
|
} |
||||
|
|
||||
|
private func getHUmanReadableDate(date: String?) -> String? { |
||||
|
if let date = DateFormatter.toDate(dateString: date ?? "", format: AppConstants.dateFormat) { |
||||
|
let dateString = DateFormatter.toString(date: date, format: AppConstants.humanReadableDateFormat) |
||||
|
return dateString |
||||
|
} |
||||
|
return nil |
||||
|
} |
||||
|
|
||||
|
private func setup() { |
||||
|
// all setup should be done here |
||||
|
setupSearchTextField() |
||||
|
setupDelegates() |
||||
|
self.transactionType = .all |
||||
|
self.dateRangeLabelHeightConstraint.constant = 0 |
||||
|
} |
||||
|
|
||||
|
private func setupSearchTextField() { |
||||
|
let imageview = UIImageView(image: #imageLiteral(resourceName: "ic_search")) |
||||
|
self.searchTextField.leftView = imageview |
||||
|
self.searchTextField.leftViewMode = .always |
||||
|
self.searchTextField.addTarget(self, action: #selector(search(sender:)), for: UIControlEvents.editingChanged) |
||||
|
} |
||||
|
|
||||
|
@objc func search(sender: UITextField) { |
||||
|
let searchText = sender.text! |
||||
|
self.presenter?.search(text: searchText) |
||||
|
} |
||||
|
|
||||
|
private func setupDelegates() { |
||||
|
self.tableView.delegate = self |
||||
|
self.tableView.dataSource = self |
||||
|
} |
||||
|
|
||||
|
private func setupNavigation() { |
||||
|
var backBtnImage = #imageLiteral(resourceName: "backIconBlack") |
||||
|
backBtnImage = backBtnImage.withRenderingMode(UIImageRenderingMode.alwaysOriginal) |
||||
|
self.navigationController!.navigationBar.backIndicatorImage = backBtnImage |
||||
|
self.navigationController!.navigationBar.backIndicatorTransitionMaskImage = backBtnImage |
||||
|
self.navigationController?.navigationBar.barTintColor = UIColor.white |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
// MARK: TransactionHistoryViewInterface |
||||
|
extension TransactionHistoryViewController: TransactionHistoryViewInterface { |
||||
|
func showLoading() { |
||||
|
self.showProgressHud() |
||||
|
} |
||||
|
|
||||
|
func hideLoading() { |
||||
|
self.hideProgressHud() |
||||
|
} |
||||
|
|
||||
|
func show(error: String) { |
||||
|
self.alert(message: error) |
||||
|
} |
||||
|
|
||||
|
func show(models: [TransactionModel]) { |
||||
|
self.transactions = models |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
// MARK: TableViewDelegate |
||||
|
extension TransactionHistoryViewController: UITableViewDelegate { |
||||
|
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { |
||||
|
self.presenter?.showDetailOf(index: indexPath.row) |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
// MARK: TableViewDatasource |
||||
|
extension TransactionHistoryViewController: UITableViewDataSource { |
||||
|
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { |
||||
|
return transactions.count |
||||
|
} |
||||
|
|
||||
|
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { |
||||
|
let cell = tableView.dequeueReusableCell(withIdentifier: "TransactionHistoryTableViewCell") as! TransactionHistoryTableViewCell |
||||
|
cell.model = self.transactions.elementAt(index: indexPath.row) |
||||
|
cell.setup() |
||||
|
return cell |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
extension DateFormatter { |
||||
|
static func toDate(dateString: String, format: String = AppConstants.dateFormat) -> Date? { |
||||
|
let dateFormatter = DateFormatter() |
||||
|
dateFormatter.dateFormat = format |
||||
|
// dateFormatter.locale = Locale(identifier: "en_Us") |
||||
|
return dateFormatter.date(from: dateString) |
||||
|
} |
||||
|
|
||||
|
static func toString(date: Date, format: String = AppConstants.humanReadableDateFormat) -> String { |
||||
|
let dateFormatter = DateFormatter() |
||||
|
dateFormatter.dateFormat = format |
||||
|
// dateFormatter.locale = Locale(identifier: "en_US") |
||||
|
return dateFormatter.string(from: date) |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
@ -0,0 +1,14 @@ |
|||||
|
// |
||||
|
// TransactionHistoryViewInterface.swift |
||||
|
// GMERemittance |
||||
|
// |
||||
|
// Created by gme_2 on 28/09/2018. |
||||
|
//Copyright © 2018 Gobal Money Express Co. Ltd. All rights reserved. |
||||
|
// |
||||
|
|
||||
|
protocol TransactionHistoryViewInterface: class { |
||||
|
func showLoading() |
||||
|
func hideLoading() |
||||
|
func show(error: String) |
||||
|
func show(models: [TransactionModel]) |
||||
|
} |
@ -0,0 +1,43 @@ |
|||||
|
// |
||||
|
// TransactionHistoryWireframe.swift |
||||
|
// GMERemittance |
||||
|
// |
||||
|
// Created by gme_2 on 28/09/2018. |
||||
|
//Copyright © 2018 Gobal Money Express Co. Ltd. All rights reserved. |
||||
|
// |
||||
|
|
||||
|
import UIKit |
||||
|
|
||||
|
class TransactionHistoryWireframe { |
||||
|
weak var view: UIViewController! |
||||
|
let reciptWireframe = SendMoneyReceiptWireframe() |
||||
|
} |
||||
|
|
||||
|
extension TransactionHistoryWireframe: TransactionHistoryWireframeInput { |
||||
|
|
||||
|
var storyboardName: String {return "TransactionHistory"} |
||||
|
|
||||
|
func getMainView() -> UIViewController { |
||||
|
let service = TransactionHistoryService() |
||||
|
let interactor = TransactionHistoryInteractor(service: service) |
||||
|
let presenter = TransactionHistoryPresenter() |
||||
|
let viewController = viewControllerFromStoryboard(of: TransactionHistoryViewController.self) |
||||
|
|
||||
|
viewController.presenter = presenter |
||||
|
interactor.output = presenter |
||||
|
presenter.interactor = interactor |
||||
|
presenter.wireframe = self |
||||
|
presenter.view = viewController |
||||
|
|
||||
|
self.view = viewController |
||||
|
return viewController |
||||
|
} |
||||
|
|
||||
|
func openReciept(transactionId: String) { |
||||
|
if let navigation = self.view.navigationController { |
||||
|
reciptWireframe.openRecieptWithBackButton(transactionId: transactionId, source: navigation) |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,13 @@ |
|||||
|
// |
||||
|
// TransactionHistoryWireframeInput.swift |
||||
|
// GMERemittance |
||||
|
// |
||||
|
// Created by gme_2 on 28/09/2018. |
||||
|
//Copyright © 2018 Gobal Money Express Co. Ltd. All rights reserved. |
||||
|
// |
||||
|
|
||||
|
import Foundation |
||||
|
|
||||
|
protocol TransactionHistoryWireframeInput: WireframeInput { |
||||
|
func openReciept(transactionId: String) |
||||
|
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue