Dimitris Togias

fix implementation details

......@@ -19,6 +19,7 @@
1EBE97212865EE460080EFF7 /* MFYInboxTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EBE97202865EE460080EFF7 /* MFYInboxTableViewCell.swift */; };
1EBF5F072840E13F00B8B17F /* SwiftEventBus in Frameworks */ = {isa = PBXBuildFile; productRef = 1EBF5F062840E13F00B8B17F /* SwiftEventBus */; };
7630AD9A6242D60846D6750C /* Pods_SwiftWarplyFramework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C0D5F56DD4E5371A50AD2D87 /* Pods_SwiftWarplyFramework.framework */; };
A04D31DE288FF670000E43B5 /* HistoryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A04D31DD288FF670000E43B5 /* HistoryViewController.swift */; };
A079366E2885D07700064122 /* AnalysisChildViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A079366D2885D07700064122 /* AnalysisChildViewController.swift */; };
A07936702885D95600064122 /* AnalysisItemViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A079366F2885D95600064122 /* AnalysisItemViewCell.swift */; };
A07936732885E67400064122 /* AnalysisItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = A07936722885E67400064122 /* AnalysisItem.swift */; };
......@@ -165,6 +166,7 @@
1EB5F4C728536FD60016F36E /* StepsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StepsViewController.swift; sourceTree = "<group>"; };
1EB5F4C9285370C90016F36E /* LoyaltyAnalysisViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoyaltyAnalysisViewController.swift; sourceTree = "<group>"; };
1EBE97202865EE460080EFF7 /* MFYInboxTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MFYInboxTableViewCell.swift; sourceTree = "<group>"; };
A04D31DD288FF670000E43B5 /* HistoryViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HistoryViewController.swift; sourceTree = "<group>"; };
A079366D2885D07700064122 /* AnalysisChildViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnalysisChildViewController.swift; sourceTree = "<group>"; };
A079366F2885D95600064122 /* AnalysisItemViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnalysisItemViewCell.swift; sourceTree = "<group>"; };
A07936722885E67400064122 /* AnalysisItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnalysisItem.swift; sourceTree = "<group>"; };
......@@ -333,6 +335,7 @@
A079367A2885F2D100064122 /* cells */,
1EB5F4C9285370C90016F36E /* LoyaltyAnalysisViewController.swift */,
A079366D2885D07700064122 /* AnalysisChildViewController.swift */,
A04D31DD288FF670000E43B5 /* HistoryViewController.swift */,
A09DBCAD2888BA8100DD50B0 /* SharingHistoryViewController.swift */,
);
name = analysis;
......@@ -888,6 +891,7 @@
E6A7791A282933E60045BBA8 /* WLAPPActionHandler.m in Sources */,
E6A778E1282933E60045BBA8 /* CouponViewController.swift in Sources */,
E6A77924282933E70045BBA8 /* NSString+SSToolkitAdditions.m in Sources */,
A04D31DE288FF670000E43B5 /* HistoryViewController.swift in Sources */,
E6A7792A282933E70045BBA8 /* AFNetworkActivityIndicatorManager.m in Sources */,
E6A77914282933E60045BBA8 /* WLUserManager.m in Sources */,
1EB236AF28816CAC0063777A /* NumbersTableViewCell.swift in Sources */,
......
......@@ -14,10 +14,15 @@ class AnalysisHeaderMessageViewCell: UITableViewCell {
@IBOutlet weak var messageLabel: UILabel!
@IBOutlet weak var titleLabel: UILabel!
public var loyaltyBadge:swiftApi.LoyaltyBadgeModel = swiftApi().getLoyaltyBadge()
// lifecycle
override func awakeFromNib() {
super.awakeFromNib()
// image
itemImage.image = UIImage(named: "ic_gift_circle", in: Bundle(for: MyEmptyClass.self), compatibleWith: nil)
// title
titleLabel.textColor = UIColor(rgb: 0x435563)
titleLabel.text = "Αναλυτικά:"
......@@ -26,7 +31,12 @@ class AnalysisHeaderMessageViewCell: UITableViewCell {
messageLabel.textColor = UIColor(rgb: 0x435563)
messageLabel.layer.borderWidth = 1.0
messageLabel.layer.borderColor = UIColor(rgb: 0xB2CE69).cgColor
messageLabel.text = "Μέχρι τώρα έχεις κερδίσει 20,00€ σε προσφορές από 3 κουπόνια!"
let totalCouponDiscount = Float(round(100 * loyaltyBadge._value) / 100)
var totalCouponDiscountString = "0"
totalCouponDiscountString = String(format: "%.2f", totalCouponDiscount).replacingOccurrences(of: ".", with: ",", options: .literal, range: nil)
messageLabel.text = "Μέχρι τώρα έχεις κερδίσει " + totalCouponDiscountString + "€ σε προσφορές από " + String(loyaltyBadge._couponCount) + " κουπόνια!"
}
}
......
......@@ -17,6 +17,9 @@ class AnalysisHeaderViewCell: UITableViewCell {
override func awakeFromNib() {
super.awakeFromNib()
// image
itemImage.image = UIImage(named: "ic_gift_circle", in: Bundle(for: MyEmptyClass.self), compatibleWith: nil)
// title
titleLabel.textColor = UIColor(rgb: 0x435563)
titleLabel.text = "Αναλυτικά:"
......
......@@ -34,27 +34,41 @@ class AnalysisItemViewCell: UITableViewCell {
}
extension AnalysisItemViewCell {
func configureCell(item: swiftApi.SharingCouponModel) {
// TODO: this is not optimal. we need a static date formatter. we cannot instantiate a new object each time we render a new item.
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "dd-MM-yyyy"
if let date = item.date {
let dateString = dateFormatter.string(from: date)
dateLabel.text = dateString
} else {
dateLabel.text = ""
}
func configureCell(item: swiftApi.SharingCouponModel) {
dateLabel.text = item._date
//itemImage.image =
titleLabel.text = item.name
priceLabel.text = String(format: "%.2f€", item.discount)
titleLabel.text = item._name
let priceFloat = Float(round(100 * (Float(item._discount) ?? 0.0)) / 100)
var priceString = "0"
priceString = String(format: "%.2f", priceFloat).replacingOccurrences(of: ".", with: ",", options: .literal, range: nil)
priceLabel.text = priceString + "€"
if ("sent" == item.sharingType) {
subtitleLabel.text = String(format: "Εκπτωτικό κουπόνι προς @%", "69740000000")
} else if ("received" == item.sharingType) {
subtitleLabel.text = String(format: "Εκπτωτικό κουπόνι από @%", "69740000000")
if ("sent" == item._sharing_type) {
subtitleLabel.text = String(format: "Εκπτωτικό κουπόνι προς " + item._receiver_msisdn)
} else if ("received" == item._sharing_type) {
subtitleLabel.text = String(format: "Εκπτωτικό κουπόνι από " + item._sender_msisdn)
}
}
func configureCell(item: swiftApi.CouponItemModel) {
// COUPONSET: desc, img_preview, name, terms
// COUPON: coupon, expiration, discount, status
let couponSetData: swiftApi.CouponSetItemModel? = item.couponset_data
dateLabel.text = item.expiration ?? "" // TODO: change
itemImage.load(link: couponSetData?.img_preview ?? "", placeholder: UIImage(), cache: URLCache())
titleLabel.text = couponSetData?.name ?? ""
let priceFloat = Float(round(100 * (Float(item.discount ?? "") ?? 0.0)) / 100)
var priceString = "0"
priceString = String(format: "%.2f", priceFloat).replacingOccurrences(of: ".", with: ",", options: .literal, range: nil)
priceLabel.text = priceString + "€"
subtitleLabel.text = couponSetData?.short_description ?? ""
}
}
......
//
// HistoryViewController.swift
// SwiftWarplyFramework
//
// Created by Manos Chorianopoulos on 18/7/22.
//
import UIKit
class HistoryViewController: AnalysisChildViewController {
var loading: Bool = false
var items: Array<swiftApi.CouponItemModel> = swiftApi().getCouponList()
// TODO: remove this when configuring model
let hasMessage = true
// lifecycle
override func viewDidLoad() {
super.viewDidLoad()
self.refreshControl = UIRefreshControl()
self.refreshControl?.addTarget(self, action: #selector(handleRefresh(_:)), for: .valueChanged)
handleRefresh(self.refreshControl!)
}
// mvp
@objc func load() {
if (loading) {
return;
}
showLoading()
items = swiftApi().getOldCouponList()
showContent()
self.tableView.reloadData()
}
private func showLoading() {
loading = true
if (self.refreshControl!.isRefreshing) {
return;
}
self.refreshControl!.beginRefreshing()
}
private func showError() {
}
private func showContent() {
loading = false
self.refreshControl!.endRefreshing()
}
// private
func responseCallback (_ data: Array<swiftApi.CouponItemModel>?) -> Void {
self.items = data!
showContent()
DispatchQueue.main.async {
self.tableView.reloadData()
}
}
@objc func handleRefresh(_ refreshControl: UIRefreshControl) {
self.perform(_: #selector(load), with: nil, afterDelay: 0.5)
}
// MARK: - Table view data source
override func numberOfSections(in tableView: UITableView) -> Int {
return 2
}
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if (section == 0) {
return 1;
}
return items.count
}
override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if (indexPath.section == 0) {
return hasMessage ? 380.0 : 280
}
return 140.0
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
// header
if (indexPath.section == 0) {
if (hasMessage) {
return tableView.dequeueReusableCell(withIdentifier: "AnalysisHeaderMessageViewCell", for: indexPath) as! AnalysisHeaderMessageViewCell
}
return tableView.dequeueReusableCell(withIdentifier: "AnalysisHeaderViewCell", for: indexPath) as! AnalysisHeaderViewCell
}
let cell = tableView.dequeueReusableCell(withIdentifier: "AnalysisItemViewCell", for: indexPath) as! AnalysisItemViewCell
cell.configureCell(item: items[indexPath.row])
return cell
}
}
......@@ -21,7 +21,7 @@ import RESegmentedControl
// setup view
setBackButton()
setNavigationTitle("Analysis")
setNavigationTitle("Ανάλυση")
// tab
let titles = ["Εξαργυρωμένα", "Μοιρασμένα δώρα"]
......@@ -41,24 +41,28 @@ import RESegmentedControl
addChild(pageController)
contentView.addSubview(pageController.view)
pageController .didMove(toParent: self)
let analysisVC = self.viewControllerAt(0)
pageController.setViewControllers([analysisVC!], direction:.forward, animated:false)
}
////////////////////////////////////////////////////////////////////////////////
private func viewControllerAt(_ index:Int) -> AnalysisChildViewController?
{
let storyboard = UIStoryboard(name: "Main", bundle: nil)
if (index == 1) {
let analysisVC = SharingHistoryViewController()
let analysisVC = storyboard.instantiateViewController(withIdentifier:"SharingHistoryViewController") as! SharingHistoryViewController
analysisVC.index = index;
return analysisVC;
}
let analysisVC = AnalysisChildViewController()
let analysisVC = storyboard.instantiateViewController(withIdentifier:"HistoryViewController") as! HistoryViewController
analysisVC.index = index;
return analysisVC;
}
}
// MARK: - PageViewController
......
......@@ -379,7 +379,7 @@
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Ee1-aw-PRJ" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1535" y="837"/>
<point key="canvasLocation" x="1612" y="836"/>
</scene>
<!--Steps View Controller-->
<scene sceneID="BCE-JX-L0C">
......@@ -430,16 +430,17 @@
</view>
<connections>
<outlet property="contentView" destination="FyK-3t-liP" id="lBC-DU-jIb"/>
<outlet property="tabView" destination="Z7V-En-7Tl" id="V5w-xL-IBc"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="jF4-GM-aCp" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="3229" y="836"/>
<point key="canvasLocation" x="3125" y="836"/>
</scene>
<!--Analysis Child View Controller-->
<!--Sharing History View Controller-->
<scene sceneID="Yng-iu-80u">
<objects>
<tableViewController id="xOZ-Af-1Nw" customClass="AnalysisChildViewController" customModule="SwiftWarplyFramework" customModuleProvider="target" sceneMemberID="viewController">
<tableViewController id="xOZ-Af-1Nw" customClass="SharingHistoryViewController" customModule="SwiftWarplyFramework" customModuleProvider="target" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="160" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" id="IAk-m8-ZIC">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
......@@ -517,7 +518,7 @@
<outlet property="titleLabel" destination="hqA-F6-n9s" id="zlL-DU-81T"/>
</connections>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" rowHeight="280" id="HMC-zK-06F" customClass="AnalysisHeaderViewCell" customModule="SwiftWarplyFramework" customModuleProvider="target">
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="AnalysisHeaderViewCell" rowHeight="280" id="HMC-zK-06F" customClass="AnalysisHeaderViewCell" customModule="SwiftWarplyFramework" customModuleProvider="target">
<rect key="frame" x="0.0" y="204.5" width="414" height="280"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="HMC-zK-06F" id="RtV-Li-Dnj">
......@@ -553,7 +554,7 @@
<outlet property="titleLabel" destination="LKw-8l-mRY" id="2Nl-uC-2aJ"/>
</connections>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" rowHeight="380" id="oPh-jz-GSZ" customClass="AnalysisHeaderMessageViewCell" customModule="SwiftWarplyFramework" customModuleProvider="target">
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="AnalysisHeaderMessageViewCell" rowHeight="380" id="oPh-jz-GSZ" customClass="AnalysisHeaderMessageViewCell" customModule="SwiftWarplyFramework" customModuleProvider="target">
<rect key="frame" x="0.0" y="484.5" width="414" height="380"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="oPh-jz-GSZ" id="8oK-tI-pLa">
......@@ -611,7 +612,7 @@
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="4gQ-3O-aEc" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="3942.0289855072465" y="835.71428571428567"/>
<point key="canvasLocation" x="3903" y="836"/>
</scene>
<!--Wallet View Controller-->
<scene sceneID="tSr-9x-GQW">
......@@ -817,19 +818,19 @@
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="2" translatesAutoresizingMaskIntoConstraints="NO" id="MCY-xv-vpg">
<rect key="frame" x="20" y="20" width="254" height="60.5"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Ενεργός κωδικός:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ucC-u4-AQL">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Ενεργός κωδικός:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ucC-u4-AQL">
<rect key="frame" x="0.0" y="0.0" width="254" height="21.5"/>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="18"/>
<color key="textColor" red="0.23529411759999999" green="0.32549019610000002" blue="0.39607843139999999" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="961544809" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="qBe-Jw-QUx">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="961544809" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="qBe-Jw-QUx">
<rect key="frame" x="0.0" y="23.5" width="254" height="21.5"/>
<fontDescription key="fontDescription" type="system" weight="heavy" pointSize="18"/>
<color key="textColor" red="0.23529411759999999" green="0.32549019610000002" blue="0.39607843139999999" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Λήγει σε 4 ημέρες" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="qL0-3b-eqA">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Λήγει σε 4 ημέρες" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="qL0-3b-eqA">
<rect key="frame" x="0.0" y="47" width="254" height="13.5"/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="11"/>
<color key="textColor" red="0.2274509804" green="0.32156862749999998" blue="0.40000000000000002" alpha="1" colorSpace="calibratedRGB"/>
......@@ -1916,7 +1917,7 @@
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="HMq-Fe-QT6" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="2951" y="144"/>
<point key="canvasLocation" x="3125" y="129"/>
</scene>
<!--Active Gifts View Controller-->
<scene sceneID="GKF-Re-TAp">
......@@ -1945,7 +1946,184 @@
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dOF-5b-vTf" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="3590" y="144"/>
<point key="canvasLocation" x="3903" y="129"/>
</scene>
<!--History View Controller-->
<scene sceneID="KER-Da-ryV">
<objects>
<tableViewController id="ze6-Kr-Io4" customClass="HistoryViewController" customModule="SwiftWarplyFramework" customModuleProvider="target" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="160" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" id="qD1-U4-LYx">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" selectionStyle="default" indentationWidth="10" reuseIdentifier="AnalysisItemViewCell" rowHeight="160" id="mwO-Y9-Whd" customClass="AnalysisItemViewCell" customModule="SwiftWarplyFramework" customModuleProvider="target">
<rect key="frame" x="0.0" y="44.5" width="414" height="160"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="mwO-Y9-Whd" id="4Lb-Ez-2D5">
<rect key="frame" x="0.0" y="0.0" width="414" height="160"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="05/05/2022" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ZqN-UN-x9M" userLabel="Date">
<rect key="frame" x="10" y="20" width="394" height="16"/>
<constraints>
<constraint firstAttribute="height" constant="16" id="Vgv-VT-mzv"/>
</constraints>
<fontDescription key="fontDescription" type="boldSystem" pointSize="13"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="VHu-ds-i1E">
<rect key="frame" x="10" y="46" width="28" height="28"/>
<constraints>
<constraint firstAttribute="width" constant="28" id="0eN-xR-ec6"/>
<constraint firstAttribute="height" constant="28" id="OZS-QM-eof"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="4,00€" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ZGs-RN-c7E" userLabel="Price">
<rect key="frame" x="341.5" y="50" width="52.5" height="20"/>
<constraints>
<constraint firstAttribute="height" constant="20" id="VS4-Dn-eBF"/>
</constraints>
<fontDescription key="fontDescription" type="boldSystem" pointSize="18"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="248" verticalHuggingPriority="251" text="BOX" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="9Ag-Sp-uXt" userLabel="Title">
<rect key="frame" x="42" y="50" width="295.5" height="20"/>
<constraints>
<constraint firstAttribute="height" constant="20" id="U6X-e9-8w7"/>
</constraints>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="18"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="248" verticalHuggingPriority="251" text="Έκπτωτικό κουπόνι" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="4bA-Ab-3q1" userLabel="Subtitle">
<rect key="frame" x="42" y="72" width="295.5" height="21.5"/>
<fontDescription key="fontDescription" type="system" pointSize="18"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstItem="9Ag-Sp-uXt" firstAttribute="leading" secondItem="VHu-ds-i1E" secondAttribute="trailing" constant="4" id="5Df-Np-oYZ"/>
<constraint firstAttribute="trailing" secondItem="ZGs-RN-c7E" secondAttribute="trailing" constant="20" id="7wc-o5-29i"/>
<constraint firstItem="ZGs-RN-c7E" firstAttribute="leading" secondItem="9Ag-Sp-uXt" secondAttribute="trailing" constant="4" id="Hjq-nc-G40"/>
<constraint firstItem="ZqN-UN-x9M" firstAttribute="leading" secondItem="4Lb-Ez-2D5" secondAttribute="leading" constant="10" id="PT7-de-Fld"/>
<constraint firstItem="VHu-ds-i1E" firstAttribute="leading" secondItem="4Lb-Ez-2D5" secondAttribute="leading" constant="10" id="Psu-2D-Icf"/>
<constraint firstItem="9Ag-Sp-uXt" firstAttribute="centerY" secondItem="VHu-ds-i1E" secondAttribute="centerY" id="Px2-r8-FUX"/>
<constraint firstItem="4bA-Ab-3q1" firstAttribute="top" secondItem="9Ag-Sp-uXt" secondAttribute="bottom" constant="2" id="VrB-Ui-gWz"/>
<constraint firstItem="4bA-Ab-3q1" firstAttribute="trailing" secondItem="9Ag-Sp-uXt" secondAttribute="trailing" id="bhA-o7-Cso"/>
<constraint firstItem="ZGs-RN-c7E" firstAttribute="centerY" secondItem="VHu-ds-i1E" secondAttribute="centerY" id="hDC-IU-u0r"/>
<constraint firstAttribute="trailing" secondItem="ZqN-UN-x9M" secondAttribute="trailing" constant="10" id="rSB-Gw-mg0"/>
<constraint firstItem="VHu-ds-i1E" firstAttribute="top" secondItem="ZqN-UN-x9M" secondAttribute="bottom" constant="10" id="rY7-hZ-thV"/>
<constraint firstItem="4bA-Ab-3q1" firstAttribute="leading" secondItem="9Ag-Sp-uXt" secondAttribute="leading" id="vSP-D0-3lM"/>
<constraint firstItem="ZqN-UN-x9M" firstAttribute="top" secondItem="4Lb-Ez-2D5" secondAttribute="top" constant="20" id="wui-T5-7cH"/>
</constraints>
</tableViewCellContentView>
<connections>
<outlet property="dateLabel" destination="ZqN-UN-x9M" id="GvG-Jp-72t"/>
<outlet property="itemImage" destination="VHu-ds-i1E" id="hie-z9-0r4"/>
<outlet property="priceLabel" destination="ZGs-RN-c7E" id="pMD-5S-hAB"/>
<outlet property="subtitleLabel" destination="4bA-Ab-3q1" id="cGH-SR-2cx"/>
<outlet property="titleLabel" destination="9Ag-Sp-uXt" id="FN2-u8-I6a"/>
</connections>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="AnalysisHeaderViewCell" rowHeight="280" id="TXv-Qw-94X" customClass="AnalysisHeaderViewCell" customModule="SwiftWarplyFramework" customModuleProvider="target">
<rect key="frame" x="0.0" y="204.5" width="414" height="280"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="TXv-Qw-94X" id="fmq-OF-USg">
<rect key="frame" x="0.0" y="0.0" width="414" height="280"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Lul-sk-Xaj">
<rect key="frame" x="124" y="31" width="166" height="166"/>
<constraints>
<constraint firstAttribute="height" constant="166" id="gOb-nT-us3"/>
<constraint firstAttribute="width" constant="166" id="pY8-aZ-nnb"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Αναλυτικά:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="XjQ-Dg-ucn">
<rect key="frame" x="162" y="248" width="90" height="22"/>
<constraints>
<constraint firstAttribute="height" constant="22" id="Ccg-Xm-m6C"/>
</constraints>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="18"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstItem="XjQ-Dg-ucn" firstAttribute="centerX" secondItem="fmq-OF-USg" secondAttribute="centerX" id="Lbh-ZU-mWb"/>
<constraint firstAttribute="bottom" secondItem="XjQ-Dg-ucn" secondAttribute="bottom" constant="10" id="b1r-ZX-eVt"/>
<constraint firstItem="Lul-sk-Xaj" firstAttribute="centerX" secondItem="fmq-OF-USg" secondAttribute="centerX" id="hOd-Db-G3B"/>
<constraint firstItem="Lul-sk-Xaj" firstAttribute="top" secondItem="fmq-OF-USg" secondAttribute="topMargin" constant="20" id="p5M-bI-lEn"/>
</constraints>
</tableViewCellContentView>
<connections>
<outlet property="itemImage" destination="Lul-sk-Xaj" id="yG3-o7-77x"/>
<outlet property="titleLabel" destination="XjQ-Dg-ucn" id="1uG-vu-ajJ"/>
</connections>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="AnalysisHeaderMessageViewCell" rowHeight="380" id="9cE-DQ-oc7" customClass="AnalysisHeaderMessageViewCell" customModule="SwiftWarplyFramework" customModuleProvider="target">
<rect key="frame" x="0.0" y="484.5" width="414" height="380"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="9cE-DQ-oc7" id="Kcf-Zv-eMe">
<rect key="frame" x="0.0" y="0.0" width="414" height="380"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Μέχρι τώρα έχεις κερδίσει 20,00€ σε προσφορές από 3 κουπόνια!" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Yth-0S-P60">
<rect key="frame" x="50" y="237" width="314" height="60"/>
<constraints>
<constraint firstAttribute="height" constant="60" id="Ams-n8-yUP"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="QY9-ar-jbw">
<rect key="frame" x="124" y="31" width="166" height="166"/>
<constraints>
<constraint firstAttribute="width" constant="166" id="ZuH-X9-Nie"/>
<constraint firstAttribute="height" constant="166" id="dUQ-Ou-Apu"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Αναλυτικά:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="nzx-D5-LHo">
<rect key="frame" x="166" y="339" width="82" height="20"/>
<constraints>
<constraint firstAttribute="height" constant="20" id="K9D-vL-Saj"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstAttribute="trailingMargin" secondItem="Yth-0S-P60" secondAttribute="trailing" constant="30" id="6SE-2z-kcV"/>
<constraint firstItem="QY9-ar-jbw" firstAttribute="top" secondItem="Kcf-Zv-eMe" secondAttribute="topMargin" constant="20" id="7r7-Q0-rq4"/>
<constraint firstItem="nzx-D5-LHo" firstAttribute="centerX" secondItem="Kcf-Zv-eMe" secondAttribute="centerX" id="9MU-dy-Lh7"/>
<constraint firstItem="Yth-0S-P60" firstAttribute="top" secondItem="QY9-ar-jbw" secondAttribute="bottom" constant="40" id="f7j-JG-hqO"/>
<constraint firstItem="Yth-0S-P60" firstAttribute="leading" secondItem="Kcf-Zv-eMe" secondAttribute="leadingMargin" constant="30" id="qsD-vg-jYM"/>
<constraint firstAttribute="bottomMargin" secondItem="nzx-D5-LHo" secondAttribute="bottom" constant="10" id="tgQ-Ov-G72"/>
<constraint firstItem="QY9-ar-jbw" firstAttribute="centerX" secondItem="Kcf-Zv-eMe" secondAttribute="centerX" id="xiH-Cs-G6E"/>
</constraints>
</tableViewCellContentView>
<connections>
<outlet property="itemImage" destination="QY9-ar-jbw" id="UHu-bz-9Uk"/>
<outlet property="messageLabel" destination="Yth-0S-P60" id="tVN-jB-FvL"/>
<outlet property="titleLabel" destination="nzx-D5-LHo" id="cU7-6c-HiO"/>
</connections>
</tableViewCell>
</prototypes>
<connections>
<outlet property="dataSource" destination="ze6-Kr-Io4" id="XcZ-cQ-TzG"/>
<outlet property="delegate" destination="ze6-Kr-Io4" id="pAt-Pk-8Z1"/>
</connections>
</tableView>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="8Bf-SH-BtT" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="4654" y="836"/>
</scene>
</scenes>
<resources>
......
......@@ -13,7 +13,7 @@ class SharingHistoryViewController: AnalysisChildViewController {
var items: Array<swiftApi.SharingCouponModel> = Array()
// TODO: remove this when configuring model
let hasMessage = true
let hasMessage = false
// lifecycle
override func viewDidLoad() {
......@@ -35,7 +35,7 @@ class SharingHistoryViewController: AnalysisChildViewController {
showLoading()
// TODO: Implement API call
swiftApi().getSharingHistoryAsync(responseCallback)
}
private func showLoading() {
......@@ -53,7 +53,7 @@ class SharingHistoryViewController: AnalysisChildViewController {
private func showContent() {
loading = true
loading = false
self.refreshControl!.endRefreshing()
}
......@@ -90,7 +90,7 @@ class SharingHistoryViewController: AnalysisChildViewController {
return hasMessage ? 380.0 : 280
}
return 160.0
return 140.0
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
......