Manos Chorianopoulos

Merge remote-tracking branch 'origin/feat/analysis_vc' into swift_sdk_development

......@@ -20,6 +20,15 @@
1EBF5F072840E13F00B8B17F /* SwiftEventBus in Frameworks */ = {isa = PBXBuildFile; productRef = 1EBF5F062840E13F00B8B17F /* SwiftEventBus */; };
7630AD9A6242D60846D6750C /* Pods_SwiftWarplyFramework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C0D5F56DD4E5371A50AD2D87 /* Pods_SwiftWarplyFramework.framework */; };
A02F34052882B6E60086465F /* TelcoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A02F34042882B6E60086465F /* TelcoViewController.swift */; };
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 */; };
A07936762885E9CC00064122 /* UIColorExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = A07936752885E9CC00064122 /* UIColorExtensions.swift */; };
A07936792885EF9400064122 /* RESegmentedControl in Frameworks */ = {isa = PBXBuildFile; productRef = A07936782885EF9400064122 /* RESegmentedControl */; };
A079367C2885F2F500064122 /* AnalysisHeaderViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A079367B2885F2F500064122 /* AnalysisHeaderViewCell.swift */; };
A079367E2885F60A00064122 /* AnalysisHeaderMessageViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A079367D2885F60A00064122 /* AnalysisHeaderMessageViewCell.swift */; };
A09DBCAE2888BA8100DD50B0 /* SharingHistoryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A09DBCAD2888BA8100DD50B0 /* SharingHistoryViewController.swift */; };
E6A77853282933340045BBA8 /* SwiftWarplyFramework.docc in Sources */ = {isa = PBXBuildFile; fileRef = E6A77852282933340045BBA8 /* SwiftWarplyFramework.docc */; };
E6A77854282933340045BBA8 /* SwiftWarplyFramework.h in Headers */ = {isa = PBXBuildFile; fileRef = E6A77851282933340045BBA8 /* SwiftWarplyFramework.h */; settings = {ATTRIBUTES = (Public, ); }; };
E6A778DF282933E60045BBA8 /* WarplyReactMethods.m in Sources */ = {isa = PBXBuildFile; fileRef = E6A7785B282933E40045BBA8 /* WarplyReactMethods.m */; };
......@@ -159,6 +168,14 @@
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>"; };
A02F34042882B6E60086465F /* TelcoViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TelcoViewController.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>"; };
A07936752885E9CC00064122 /* UIColorExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIColorExtensions.swift; sourceTree = "<group>"; };
A079367B2885F2F500064122 /* AnalysisHeaderViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnalysisHeaderViewCell.swift; sourceTree = "<group>"; };
A079367D2885F60A00064122 /* AnalysisHeaderMessageViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnalysisHeaderMessageViewCell.swift; sourceTree = "<group>"; };
A09DBCAD2888BA8100DD50B0 /* SharingHistoryViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SharingHistoryViewController.swift; sourceTree = "<group>"; };
A9B7BE01A4E812DE49866EF8 /* Pods-SwiftWarplyFramework.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwiftWarplyFramework.debug.xcconfig"; path = "Target Support Files/Pods-SwiftWarplyFramework/Pods-SwiftWarplyFramework.debug.xcconfig"; sourceTree = "<group>"; };
B9EB8A451EF0C5AD75094EEE /* Pods-SwiftWarplyFramework.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwiftWarplyFramework.release.xcconfig"; path = "Target Support Files/Pods-SwiftWarplyFramework/Pods-SwiftWarplyFramework.release.xcconfig"; sourceTree = "<group>"; };
C0D5F56DD4E5371A50AD2D87 /* Pods_SwiftWarplyFramework.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwiftWarplyFramework.framework; sourceTree = BUILT_PRODUCTS_DIR; };
......@@ -298,6 +315,7 @@
files = (
1E2966EA2837A21D00F83FAC /* RSBarcodes_Swift in Frameworks */,
7630AD9A6242D60846D6750C /* Pods_SwiftWarplyFramework.framework in Frameworks */,
A07936792885EF9400064122 /* RESegmentedControl in Frameworks */,
1EBF5F072840E13F00B8B17F /* SwiftEventBus in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
......@@ -313,6 +331,44 @@
name = Frameworks;
sourceTree = "<group>";
};
A079366A2885CDDC00064122 /* analysis */ = {
isa = PBXGroup;
children = (
A079367A2885F2D100064122 /* cells */,
1EB5F4C9285370C90016F36E /* LoyaltyAnalysisViewController.swift */,
A079366D2885D07700064122 /* AnalysisChildViewController.swift */,
A04D31DD288FF670000E43B5 /* HistoryViewController.swift */,
A09DBCAD2888BA8100DD50B0 /* SharingHistoryViewController.swift */,
);
name = analysis;
sourceTree = "<group>";
};
A07936712885E65C00064122 /* models */ = {
isa = PBXGroup;
children = (
A07936722885E67400064122 /* AnalysisItem.swift */,
);
name = models;
sourceTree = "<group>";
};
A07936742885E96A00064122 /* utilities */ = {
isa = PBXGroup;
children = (
A07936752885E9CC00064122 /* UIColorExtensions.swift */,
);
name = utilities;
sourceTree = "<group>";
};
A079367A2885F2D100064122 /* cells */ = {
isa = PBXGroup;
children = (
A079366F2885D95600064122 /* AnalysisItemViewCell.swift */,
A079367B2885F2F500064122 /* AnalysisHeaderViewCell.swift */,
A079367D2885F60A00064122 /* AnalysisHeaderMessageViewCell.swift */,
);
name = cells;
sourceTree = "<group>";
};
C049E0423E2B72D796B777A3 /* Pods */ = {
isa = PBXGroup;
children = (
......@@ -344,6 +400,9 @@
isa = PBXGroup;
children = (
A02F34042882B6E60086465F /* TelcoViewController.swift */,
A07936712885E65C00064122 /* models */,
A079366A2885CDDC00064122 /* analysis */,
A07936742885E96A00064122 /* utilities */,
E6A7785E282933E40045BBA8 /* CouponsViewController.swift */,
1EA1AF092835346A008998AA /* CouponsTableViewCell.swift */,
E6A7785D282933E40045BBA8 /* CouponViewController.swift */,
......@@ -362,7 +421,6 @@
1EB236AA28816B680063777A /* ShareViewController.swift */,
1EB236AC28816C560063777A /* NumberPopupViewController.swift */,
1EB236AE28816CAB0063777A /* NumbersTableViewCell.swift */,
1EB5F4C9285370C90016F36E /* LoyaltyAnalysisViewController.swift */,
1EB5F4C728536FD60016F36E /* StepsViewController.swift */,
E6A77860282933E40045BBA8 /* MyApi.h */,
E6A778DC282933E60045BBA8 /* MyApi.m */,
......@@ -672,6 +730,7 @@
packageProductDependencies = (
1E2966E92837A21D00F83FAC /* RSBarcodes_Swift */,
1EBF5F062840E13F00B8B17F /* SwiftEventBus */,
A07936782885EF9400064122 /* RESegmentedControl */,
);
productName = SwiftWarplyFramework;
productReference = E6A7784E282933340045BBA8 /* SwiftWarplyFramework.framework */;
......@@ -704,6 +763,7 @@
packageReferences = (
1E2966E82837A21D00F83FAC /* XCRemoteSwiftPackageReference "RSBarcodes_Swift" */,
1EBF5F052840E13F00B8B17F /* XCRemoteSwiftPackageReference "SwiftEventBus" */,
A07936772885EF9400064122 /* XCRemoteSwiftPackageReference "RESegmentedControl" */,
);
productRefGroup = E6A7784F282933340045BBA8 /* Products */;
projectDirPath = "";
......@@ -787,10 +847,13 @@
E6A7794B282933E70045BBA8 /* FMDatabase.m in Sources */,
E6A778EC282933E60045BBA8 /* WLNativeVideoTableViewCell.m in Sources */,
E6A77954282933E70045BBA8 /* MyApi.m in Sources */,
A09DBCAE2888BA8100DD50B0 /* SharingHistoryViewController.swift in Sources */,
E6A778F2282933E60045BBA8 /* WLNativeAdCollectionViewCell.m in Sources */,
E6A77904282933E60045BBA8 /* WLEvent.m in Sources */,
E6A77927282933E70045BBA8 /* UIRefreshControl+AFNetworking.m in Sources */,
E6A77955282933E70045BBA8 /* ViewControllerExtensions.swift in Sources */,
A07936762885E9CC00064122 /* UIColorExtensions.swift in Sources */,
A079367C2885F2F500064122 /* AnalysisHeaderViewCell.swift in Sources */,
E6A7795A28293D390045BBA8 /* swiftApi.swift in Sources */,
E6A77935282933E70045BBA8 /* UIWebView+AFNetworking.m in Sources */,
E6A77925282933E70045BBA8 /* UIProgressView+AFNetworking.m in Sources */,
......@@ -800,6 +863,7 @@
E6A77917282933E60045BBA8 /* UIViewController+WLAdditions.m in Sources */,
1EA2BB792865BFE8003F2AB0 /* InboxTableViewCell.swift in Sources */,
E6A77943282933E70045BBA8 /* AFNetworkReachabilityManager.m in Sources */,
A07936702885D95600064122 /* AnalysisItemViewCell.swift in Sources */,
E6A77956282933E70045BBA8 /* GiftsViewController.swift in Sources */,
E6A778F1282933E60045BBA8 /* WLNativeAdTableViewCell.m in Sources */,
E6A77853282933340045BBA8 /* SwiftWarplyFramework.docc in Sources */,
......@@ -810,6 +874,7 @@
1EBE97212865EE460080EFF7 /* MFYInboxTableViewCell.swift in Sources */,
E6A778FD282933E60045BBA8 /* WLInboxItem.m in Sources */,
E6A778EE282933E60045BBA8 /* WLNativeAdsTableMode.m in Sources */,
A07936732885E67400064122 /* AnalysisItem.swift in Sources */,
E6A778DF282933E60045BBA8 /* WarplyReactMethods.m in Sources */,
E6A77941282933E70045BBA8 /* AFURLRequestSerialization.m in Sources */,
E6A77915282933E60045BBA8 /* WLUtils.m in Sources */,
......@@ -822,12 +887,15 @@
E6A7794A282933E70045BBA8 /* FMDatabaseAdditions.m in Sources */,
E6A77903282933E60045BBA8 /* WLAPSItem.m in Sources */,
E6A7790B282933E60045BBA8 /* WLPushManager.m in Sources */,
A079366E2885D07700064122 /* AnalysisChildViewController.swift in Sources */,
E6A77950282933E70045BBA8 /* FMResultSet.m in Sources */,
E6A77936282933E70045BBA8 /* AFAutoPurgingImageCache.m in Sources */,
A079367E2885F60A00064122 /* AnalysisHeaderMessageViewCell.swift in Sources */,
E6A778FF282933E60045BBA8 /* WLBeacon.m in Sources */,
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 */,
......@@ -1073,6 +1141,14 @@
minimumVersion = 5.0.0;
};
};
A07936772885EF9400064122 /* XCRemoteSwiftPackageReference "RESegmentedControl" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/sh-khashimov/RESegmentedControl";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 0.5.1;
};
};
/* End XCRemoteSwiftPackageReference section */
/* Begin XCSwiftPackageProductDependency section */
......@@ -1086,6 +1162,11 @@
package = 1EBF5F052840E13F00B8B17F /* XCRemoteSwiftPackageReference "SwiftEventBus" */;
productName = SwiftEventBus;
};
A07936782885EF9400064122 /* RESegmentedControl */ = {
isa = XCSwiftPackageProductDependency;
package = A07936772885EF9400064122 /* XCRemoteSwiftPackageReference "RESegmentedControl" */;
productName = RESegmentedControl;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = E6A77845282933340045BBA8 /* Project object */;
......
{
"pins" : [
{
"identity" : "resegmentedcontrol",
"kind" : "remoteSourceControl",
"location" : "https://github.com/sh-khashimov/RESegmentedControl",
"state" : {
"revision" : "09d8cbd0da906c06d30fb057ab9902dc9d0e26b9",
"version" : "0.5.1"
}
},
{
"identity" : "rsbarcodes_swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/yeahdongcn/RSBarcodes_Swift",
......
//
// AnalysisChildViewController.swift
// SwiftWarplyFramework
//
// Created by Manos Chorianopoulos on 18/7/22.
//
import UIKit
class AnalysisChildViewController: UITableViewController {
public var index: Int = -1
}
//
// AnalysisHeaderMessageViewCell.swift
// SwiftWarplyFramework
//
// Created by Manos Chorianopoulos on 18/7/22.
//
import UIKit
class AnalysisHeaderMessageViewCell: UITableViewCell {
// attributes
@IBOutlet weak var itemImage: UIImageView!
@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 = "Αναλυτικά:"
// message
messageLabel.textColor = UIColor(rgb: 0x435563)
messageLabel.layer.borderWidth = 1.0
messageLabel.layer.borderColor = UIColor(rgb: 0xB2CE69).cgColor
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) + " κουπόνια!"
}
}
extension AnalysisHeaderMessageViewCell {
func configureCell(item: AnalysisItem) {
// TODO: TO BE IMPLEMENTED
}
}
//
// AnalysisHeaderViewCell.swift
// SwiftWarplyFramework
//
// Created by Manos Chorianopoulos on 18/7/22.
//
import UIKit
class AnalysisHeaderViewCell: UITableViewCell {
// attributes
@IBOutlet weak var itemImage: UIImageView!
@IBOutlet weak var titleLabel: UILabel!
// 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 = "Αναλυτικά:"
}
}
extension AnalysisHeaderViewCell {
func configureCell(item: AnalysisItem) {
// TODO: TO BE IMPLEMENTED
}
}
//
// AnalysisItem.swift
// SwiftWarplyFramework
//
// Created by Manos Chorianopoulos on 18/7/22.
//
import UIKit
public class AnalysisItem: Codable {
// attributes
public var date: Date
public var image_url: String?
public var title: String?
public let subtitle: String?
public var price: Float
// initialization
public init() {
self.date = Date()
self.image_url = ""
self.title = ""
self.subtitle = ""
self.price = 4.0
}
}
//
// AnalysisItemViewCell.swift
// SwiftWarplyFramework
//
// Created by Manos Chorianopoulos on 18/7/22.
//
import UIKit
class AnalysisItemViewCell: UITableViewCell {
@IBOutlet weak var dateLabel: UILabel!
@IBOutlet weak var itemImage: UIImageView!
@IBOutlet weak var titleLabel: UILabel!
@IBOutlet weak var priceLabel: UILabel!
@IBOutlet weak var subtitleLabel: UILabel!
// lifecycle
override func awakeFromNib() {
super.awakeFromNib()
// date
dateLabel.textColor = UIColor(rgb: 0x435563)
// title
titleLabel.textColor = UIColor(rgb: 0x435563)
// price
priceLabel.textColor = UIColor(rgb: 0x435563)
// subtitle
subtitleLabel.textColor = UIColor(rgb: 0x8B97A3)
}
}
extension AnalysisItemViewCell {
func configureCell(item: swiftApi.SharingCouponModel) {
dateLabel.text = item._date
//itemImage.image =
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._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
}
}
......@@ -2,30 +2,133 @@
// LoyaltyAnalysisViewController.swift
// SwiftWarplyFramework
//
// Created by Manos Chorianopoulos on 10/6/22.
// Created by Manos Chorianopoulos on 18/7/22.
//
import UIKit
import RESegmentedControl
@objc public class LoyaltyAnalysisViewController: UIViewController {
@IBOutlet weak var leftButton: UIButton!
@IBOutlet weak var rightButton: UIButton!
@IBOutlet weak var contentView: UIView!
var pageController: UIPageViewController!
public override func viewDidLoad() {
super.viewDidLoad()
self.hidesBottomBarWhenPushed = true
// Do any additional setup after loading the view.
// setup view
setBackButton()
setNavigationTitle("Ανάλυση")
// tab
leftButton.setTitle("Εξαργυρωμένα", for:.normal)
leftButton.backgroundColor = . clear
leftButton.setTitleColor(UIColor(rgb: 0x2EAFB9), for:.normal)
rightButton.setTitle("Μοιρασμένα δώρα", for:.normal)
rightButton.backgroundColor = . clear
rightButton.setTitleColor(UIColor(rgb: 0x2EAFB9), for:.normal)
// pages
pageController = UIPageViewController(transitionStyle:.scroll, navigationOrientation:.horizontal)
pageController.dataSource = self;
pageController.delegate = self;
pageController.view.frame = contentView.bounds;
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 = storyboard.instantiateViewController(withIdentifier:"SharingHistoryViewController") as! SharingHistoryViewController
analysisVC.index = index;
return analysisVC;
}
/*
// MARK: - Navigation
let analysisVC = storyboard.instantiateViewController(withIdentifier:"HistoryViewController") as! HistoryViewController
analysisVC.index = index;
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destination.
// Pass the selected object to the new view controller.
return analysisVC;
}
// MARK: - Handlers
@IBAction func handleLeft() {
let analysisVC = self.viewControllerAt(0)
pageController.setViewControllers([analysisVC!], direction:.reverse, animated:true)
}
@IBAction func handleRight() {
let analysisVC = self.viewControllerAt(1)
pageController.setViewControllers([analysisVC!], direction:.forward, animated:true)
}
*/
}
// MARK: - PageViewController
extension LoyaltyAnalysisViewController: UIPageViewControllerDataSource, UIPageViewControllerDelegate {
public func pageViewController(_ pageViewController: UIPageViewController, viewControllerBefore viewController: UIViewController) -> UIViewController? {
if let analysisVC = viewController as? AnalysisChildViewController {
var index = analysisVC.index
if (index == 1) {
return nil;
}
index += 1;
return viewControllerAt(index);
}
return nil;
}
public func pageViewController(_ pageViewController: UIPageViewController, viewControllerAfter viewController: UIViewController) -> UIViewController? {
if let analysisVC = viewController as? AnalysisChildViewController {
var index = analysisVC.index
if (index == 0) {
return nil;
}
index -= 1;
return viewControllerAt(index);
}
return nil;
}
public func pageViewController(_ pageViewController: UIPageViewController, didFinishAnimating finished: Bool, previousViewControllers: [UIViewController], transitionCompleted completed: Bool) {
if (!completed) {
return;
}
if let childVCs = pageViewController.viewControllers as? [AnalysisChildViewController] {
let currentIndex = childVCs[0].index
if (currentIndex == 0) {
leftButton.isSelected = true
rightButton.isSelected = false
} else {
leftButton.isSelected = false
rightButton.isSelected = true
}
}
}
}
......
......@@ -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">
......@@ -403,13 +403,253 @@
<view key="view" contentMode="scaleToFill" id="zWp-Y3-xCW">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Z7V-En-7Tl">
<rect key="frame" x="0.0" y="44" width="414" height="50"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="liP-dN-sf3">
<rect key="frame" x="0.0" y="0.0" width="206.5" height="50"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="plain" title="Button"/>
<connections>
<action selector="handleLeft" destination="duB-b9-cnh" eventType="touchUpInside" id="eCq-GW-QAg"/>
</connections>
</button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="kAf-Oi-EnQ">
<rect key="frame" x="206.5" y="0.0" width="1" height="50"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstAttribute="width" constant="1" id="CxW-qN-ftc"/>
</constraints>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="BNZ-3e-HXp">
<rect key="frame" x="207.5" y="0.0" width="206.5" height="50"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="plain" title="Button"/>
<connections>
<action selector="handleRight" destination="duB-b9-cnh" eventType="touchUpInside" id="bo6-x4-8Ld"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="kAf-Oi-EnQ" firstAttribute="leading" secondItem="liP-dN-sf3" secondAttribute="trailing" id="7Eg-e7-UZK"/>
<constraint firstItem="liP-dN-sf3" firstAttribute="leading" secondItem="Z7V-En-7Tl" secondAttribute="leading" id="CRR-X1-VXy"/>
<constraint firstAttribute="trailing" secondItem="BNZ-3e-HXp" secondAttribute="trailing" id="FUC-Xt-vrx"/>
<constraint firstAttribute="bottom" secondItem="liP-dN-sf3" secondAttribute="bottom" id="HX4-Xg-GBR"/>
<constraint firstItem="liP-dN-sf3" firstAttribute="top" secondItem="Z7V-En-7Tl" secondAttribute="top" id="O5V-e5-NPf"/>
<constraint firstAttribute="height" constant="50" id="W4o-5O-kfL"/>
<constraint firstItem="BNZ-3e-HXp" firstAttribute="top" secondItem="Z7V-En-7Tl" secondAttribute="top" id="WtA-PL-BZy"/>
<constraint firstItem="kAf-Oi-EnQ" firstAttribute="centerX" secondItem="Z7V-En-7Tl" secondAttribute="centerX" id="jG4-gb-zWB"/>
<constraint firstAttribute="bottom" secondItem="BNZ-3e-HXp" secondAttribute="bottom" id="kzL-YN-Vkn"/>
<constraint firstItem="BNZ-3e-HXp" firstAttribute="leading" secondItem="kAf-Oi-EnQ" secondAttribute="trailing" id="zPD-7c-CdH"/>
<constraint firstItem="kAf-Oi-EnQ" firstAttribute="top" secondItem="Z7V-En-7Tl" secondAttribute="top" id="zq1-qp-f9S"/>
<constraint firstAttribute="bottom" secondItem="kAf-Oi-EnQ" secondAttribute="bottom" id="zsL-bI-ChP"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="FyK-3t-liP">
<rect key="frame" x="0.0" y="94" width="414" height="802"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
</view>
</subviews>
<viewLayoutGuide key="safeArea" id="cej-iH-8gP"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="Z7V-En-7Tl" firstAttribute="leading" secondItem="cej-iH-8gP" secondAttribute="leading" id="2VB-wC-r2b"/>
<constraint firstItem="FyK-3t-liP" firstAttribute="top" secondItem="Z7V-En-7Tl" secondAttribute="bottom" id="E4I-cW-BL9"/>
<constraint firstItem="FyK-3t-liP" firstAttribute="trailing" secondItem="cej-iH-8gP" secondAttribute="trailing" id="NTr-5G-XH5"/>
<constraint firstItem="Z7V-En-7Tl" firstAttribute="trailing" secondItem="cej-iH-8gP" secondAttribute="trailing" id="PwM-0Q-xtQ"/>
<constraint firstAttribute="bottom" secondItem="FyK-3t-liP" secondAttribute="bottom" id="fbh-Cd-dHd"/>
<constraint firstItem="Z7V-En-7Tl" firstAttribute="top" secondItem="cej-iH-8gP" secondAttribute="top" id="l8U-kf-IRu"/>
<constraint firstItem="FyK-3t-liP" firstAttribute="leading" secondItem="cej-iH-8gP" secondAttribute="leading" id="qiJ-nX-tRU"/>
</constraints>
</view>
<connections>
<outlet property="contentView" destination="FyK-3t-liP" id="lBC-DU-jIb"/>
<outlet property="leftButton" destination="liP-dN-sf3" id="PSM-x1-lPV"/>
<outlet property="rightButton" destination="BNZ-3e-HXp" id="NDe-B7-wIV"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="jF4-GM-aCp" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="3126" y="836"/>
<point key="canvasLocation" x="3124.6376811594205" y="835.71428571428567"/>
</scene>
<!--Sharing History View Controller-->
<scene sceneID="Yng-iu-80u">
<objects>
<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"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" selectionStyle="default" indentationWidth="10" reuseIdentifier="AnalysisItemViewCell" rowHeight="160" id="iNx-Id-iLB" 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="iNx-Id-iLB" id="X28-3l-fcy">
<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="fWY-zJ-P1c" userLabel="Date">
<rect key="frame" x="10" y="20" width="394" height="16"/>
<constraints>
<constraint firstAttribute="height" constant="16" id="5pR-Xb-nB2"/>
</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="rW5-M3-c7s">
<rect key="frame" x="10" y="46" width="28" height="28"/>
<constraints>
<constraint firstAttribute="height" constant="28" id="Nw7-Mi-QTe"/>
<constraint firstAttribute="width" constant="28" id="hEI-zc-TX4"/>
</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="Pyr-Jo-zxl" userLabel="Price">
<rect key="frame" x="341.5" y="50" width="52.5" height="20"/>
<constraints>
<constraint firstAttribute="height" constant="20" id="WPI-8H-zbd"/>
</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="hqA-F6-n9s" userLabel="Title">
<rect key="frame" x="42" y="50" width="295.5" height="20"/>
<constraints>
<constraint firstAttribute="height" constant="20" id="D6h-47-exa"/>
</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="xac-fs-J8S" 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="fWY-zJ-P1c" firstAttribute="top" secondItem="X28-3l-fcy" secondAttribute="top" constant="20" id="Gj8-gE-gbj"/>
<constraint firstAttribute="trailing" secondItem="fWY-zJ-P1c" secondAttribute="trailing" constant="10" id="MNz-as-PZd"/>
<constraint firstItem="hqA-F6-n9s" firstAttribute="centerY" secondItem="rW5-M3-c7s" secondAttribute="centerY" id="OpX-dx-J0h"/>
<constraint firstItem="rW5-M3-c7s" firstAttribute="top" secondItem="fWY-zJ-P1c" secondAttribute="bottom" constant="10" id="Sbw-Ar-xiH"/>
<constraint firstItem="xac-fs-J8S" firstAttribute="leading" secondItem="hqA-F6-n9s" secondAttribute="leading" id="UYN-ui-q74"/>
<constraint firstItem="rW5-M3-c7s" firstAttribute="leading" secondItem="X28-3l-fcy" secondAttribute="leading" constant="10" id="Vco-mW-IpG"/>
<constraint firstItem="fWY-zJ-P1c" firstAttribute="leading" secondItem="X28-3l-fcy" secondAttribute="leading" constant="10" id="Ynl-uB-QjI"/>
<constraint firstItem="xac-fs-J8S" firstAttribute="trailing" secondItem="hqA-F6-n9s" secondAttribute="trailing" id="bKd-IG-1da"/>
<constraint firstItem="xac-fs-J8S" firstAttribute="top" secondItem="hqA-F6-n9s" secondAttribute="bottom" constant="2" id="mQi-g5-OUm"/>
<constraint firstItem="Pyr-Jo-zxl" firstAttribute="leading" secondItem="hqA-F6-n9s" secondAttribute="trailing" constant="4" id="mzB-xA-7SR"/>
<constraint firstAttribute="trailing" secondItem="Pyr-Jo-zxl" secondAttribute="trailing" constant="20" id="nYY-Th-Hob"/>
<constraint firstItem="hqA-F6-n9s" firstAttribute="leading" secondItem="rW5-M3-c7s" secondAttribute="trailing" constant="4" id="r8B-Tl-KPA"/>
<constraint firstItem="Pyr-Jo-zxl" firstAttribute="centerY" secondItem="rW5-M3-c7s" secondAttribute="centerY" id="zif-gr-5SM"/>
</constraints>
</tableViewCellContentView>
<connections>
<outlet property="dateLabel" destination="fWY-zJ-P1c" id="zmh-T6-Uia"/>
<outlet property="itemImage" destination="rW5-M3-c7s" id="27r-CK-e8f"/>
<outlet property="priceLabel" destination="Pyr-Jo-zxl" id="hWV-75-Gqf"/>
<outlet property="subtitleLabel" destination="xac-fs-J8S" id="7ml-5a-zmc"/>
<outlet property="titleLabel" destination="hqA-F6-n9s" id="zlL-DU-81T"/>
</connections>
</tableViewCell>
<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">
<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="xmN-ke-oBj">
<rect key="frame" x="124" y="31" width="166" height="166"/>
<constraints>
<constraint firstAttribute="height" constant="166" id="OG9-xL-K4U"/>
<constraint firstAttribute="width" constant="166" id="Xgj-YV-J4n"/>
</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="LKw-8l-mRY">
<rect key="frame" x="162" y="248" width="90" height="22"/>
<constraints>
<constraint firstAttribute="height" constant="22" id="T1B-pX-6hx"/>
</constraints>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="18"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstItem="xmN-ke-oBj" firstAttribute="centerX" secondItem="RtV-Li-Dnj" secondAttribute="centerX" id="LvL-o4-MTE"/>
<constraint firstAttribute="bottom" secondItem="LKw-8l-mRY" secondAttribute="bottom" constant="10" id="jlt-UV-Eud"/>
<constraint firstItem="xmN-ke-oBj" firstAttribute="top" secondItem="RtV-Li-Dnj" secondAttribute="topMargin" constant="20" id="v4Z-tl-gBX"/>
<constraint firstItem="LKw-8l-mRY" firstAttribute="centerX" secondItem="RtV-Li-Dnj" secondAttribute="centerX" id="yJq-7A-H3r"/>
</constraints>
</tableViewCellContentView>
<connections>
<outlet property="itemImage" destination="xmN-ke-oBj" id="zRs-Ks-2Re"/>
<outlet property="titleLabel" destination="LKw-8l-mRY" id="2Nl-uC-2aJ"/>
</connections>
</tableViewCell>
<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">
<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="nkc-wO-by3">
<rect key="frame" x="50" y="237" width="314" height="60"/>
<constraints>
<constraint firstAttribute="height" constant="60" id="ZEz-dt-NJa"/>
</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="sdY-Vd-bbW">
<rect key="frame" x="124" y="31" width="166" height="166"/>
<constraints>
<constraint firstAttribute="height" constant="166" id="ZHj-a8-3y1"/>
<constraint firstAttribute="width" constant="166" id="oqg-jC-ibc"/>
</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="9MF-rh-eec">
<rect key="frame" x="166" y="339" width="82" height="20"/>
<constraints>
<constraint firstAttribute="height" constant="20" id="XkT-At-XWY"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstItem="nkc-wO-by3" firstAttribute="top" secondItem="sdY-Vd-bbW" secondAttribute="bottom" constant="40" id="2Yl-Fb-ksG"/>
<constraint firstItem="sdY-Vd-bbW" firstAttribute="top" secondItem="8oK-tI-pLa" secondAttribute="topMargin" constant="20" id="CEe-Np-pPS"/>
<constraint firstAttribute="bottomMargin" secondItem="9MF-rh-eec" secondAttribute="bottom" constant="10" id="E0e-rS-Vwh"/>
<constraint firstItem="sdY-Vd-bbW" firstAttribute="centerX" secondItem="8oK-tI-pLa" secondAttribute="centerX" id="L16-AP-9gA"/>
<constraint firstItem="nkc-wO-by3" firstAttribute="leading" secondItem="8oK-tI-pLa" secondAttribute="leadingMargin" constant="30" id="MhA-nS-gcP"/>
<constraint firstAttribute="trailingMargin" secondItem="nkc-wO-by3" secondAttribute="trailing" constant="30" id="dIv-s4-jcV"/>
<constraint firstItem="9MF-rh-eec" firstAttribute="centerX" secondItem="8oK-tI-pLa" secondAttribute="centerX" id="pKh-jT-Xoe"/>
</constraints>
</tableViewCellContentView>
<connections>
<outlet property="itemImage" destination="sdY-Vd-bbW" id="FPk-8S-kCA"/>
<outlet property="messageLabel" destination="nkc-wO-by3" id="4gl-nq-4jN"/>
<outlet property="titleLabel" destination="9MF-rh-eec" id="ogv-9c-JWm"/>
</connections>
</tableViewCell>
</prototypes>
<connections>
<outlet property="dataSource" destination="xOZ-Af-1Nw" id="rM1-30-TpG"/>
<outlet property="delegate" destination="xOZ-Af-1Nw" id="YFj-hI-ntL"/>
</connections>
</tableView>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="4gQ-3O-aEc" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="3903" y="836"/>
</scene>
<!--Wallet View Controller-->
<scene sceneID="tSr-9x-GQW">
......@@ -615,19 +855,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"/>
......@@ -1714,7 +1954,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">
......@@ -1743,7 +1983,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>
<!--Telco View Controller-->
<scene sceneID="eiY-GQ-hTe">
......
......@@ -63,6 +63,7 @@
- (NSDictionary*) getCoupons;
- (NSDictionary*) getTransactionHistory;
- (NSDictionary*) getPointsHistory;
- (NSDictionary*) getSharingHistory;
- (NSDictionary*)addAddress:(NSString*)friendlyName andAddressName:(NSString*)addressName andAddressNumber:(NSString*)addressNumber andPostalCode:(NSString*)postalCode andFloorNumber:(NSNumber*)floorNumber andDoorbell:(NSString*)doorbel andRegion:(NSString*)region andLatitude:(NSString*)latitude andLongitude:(NSString*)longitude andNotes:(NSString*)notes;
- (NSDictionary*)getAddress;
- (NSDictionary*)editAddress:(NSString*)friendlyName andAddressName:(NSString*)addressName andAddressNumber:(NSString*)addressNumber andPostalCode:(NSString*)postalCode andFloorNumber:(NSNumber*)floorNumber andDoorbell:(NSString*)doorbel andRegion:(NSString*)region andLatitude:(NSString*)latitude andLongitude:(NSString*)longitude andNotes:(NSString*)notes andUuid:(NSString*)uuid;
......
......@@ -940,6 +940,35 @@ NSString *VERIFY_URL = @"/partners/cosmote/verify";
return resp;
}
- (NSDictionary*) getSharingHistory
{
__block NSDictionary *resp = [NSDictionary alloc];
__block BOOL isRunLoopNested = NO;
__block BOOL isOperationCompleted = NO;
[[Warply sharedService] getSharingHistoryWithSuccessBlock:^(NSDictionary *response) {
resp = response;
isOperationCompleted = YES;
if (isRunLoopNested) {
CFRunLoopStop(CFRunLoopGetCurrent()); // CFRunLoopRun() returns
}
} failureBlock:^(NSError *error) {
NSLog(@"%@", error);
resp = nil;
isOperationCompleted = YES;
if (isRunLoopNested) {
CFRunLoopStop(CFRunLoopGetCurrent()); // CFRunLoopRun() returns
}
}];
if ( ! isOperationCompleted) {
isRunLoopNested = YES;
NSLog(@"Waiting...");
CFRunLoopRun(); // Magic!
isRunLoopNested = NO;
}
return resp;
}
- (NSDictionary*)addAddress:(NSString*)friendlyName andAddressName:(NSString*)addressName andAddressNumber:(NSString*)addressNumber andPostalCode:(NSString*)postalCode andFloorNumber:(NSNumber*)floorNumber andDoorbell:(NSString*)doorbel andRegion:(NSString*)region andLatitude:(NSString*)latitude andLongitude:(NSString*)longitude andNotes:(NSString*)notes {
__block NSDictionary *resp = [NSDictionary alloc];
__block BOOL isRunLoopNested = NO;
......
//
// SharingHistoryViewController.swift
// SwiftWarplyFramework
//
// Created by Manos Chorianopoulos on 18/7/22.
//
import UIKit
class SharingHistoryViewController: AnalysisChildViewController {
var loading: Bool = false
var items: Array<swiftApi.SharingCouponModel> = Array()
// TODO: remove this when configuring model
let hasMessage = false
// 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()
swiftApi().getSharingHistoryAsync(responseCallback)
}
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.SharingCouponModel>?) -> 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
}
}
//
// UIColorExtensions.swift
// SwiftWarplyFramework
//
// Created by Manos Chorianopoulos on 18/7/22.
//
import Foundation
import UIKit
extension UIColor {
convenience init(rgb: UInt) {
self.init(
red: CGFloat((rgb & 0xFF0000) >> 16) / 255.0,
green: CGFloat((rgb & 0x00FF00) >> 8) / 255.0,
blue: CGFloat(rgb & 0x0000FF) / 255.0,
alpha: CGFloat(1.0)
)
}
}
......@@ -155,7 +155,6 @@ public class swiftApi {
public func getActiveDFYCoupons() -> Array<ActiveDFYCouponModel> {
return GlobalVariables.dfyCoupons
}
public class CouponSetItemModel: Codable {
public let uuid: String?
......