Manos Chorianopoulos

MyRewardsOffersScrollTableViewCell implementation

Showing 87 changed files with 978 additions and 48 deletions
......@@ -7,6 +7,8 @@
objects = {
/* Begin PBXBuildFile section */
1E64E1832DE48E0600543217 /* MyRewardsOfferCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1E64E1822DE48E0600543217 /* MyRewardsOfferCollectionViewCell.xib */; };
1E64E1842DE48E0600543217 /* MyRewardsOfferCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E64E1812DE48E0600543217 /* MyRewardsOfferCollectionViewCell.swift */; };
1E917CD62DDF64B2002221D8 /* MyRewardsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1E917CD52DDF64B2002221D8 /* MyRewardsViewController.xib */; };
1E917CD72DDF64B2002221D8 /* MyRewardsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E917CD42DDF64B2002221D8 /* MyRewardsViewController.swift */; };
1E917CDB2DDF68C7002221D8 /* CouponViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1E917CDA2DDF68C7002221D8 /* CouponViewController.xib */; };
......@@ -148,6 +150,8 @@
/* Begin PBXFileReference section */
1E108A9728A3FA9B0008B8E7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
1E64E1812DE48E0600543217 /* MyRewardsOfferCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyRewardsOfferCollectionViewCell.swift; sourceTree = "<group>"; };
1E64E1822DE48E0600543217 /* MyRewardsOfferCollectionViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MyRewardsOfferCollectionViewCell.xib; sourceTree = "<group>"; };
1E917CD42DDF64B2002221D8 /* MyRewardsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyRewardsViewController.swift; sourceTree = "<group>"; };
1E917CD52DDF64B2002221D8 /* MyRewardsViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MyRewardsViewController.xib; sourceTree = "<group>"; };
1E917CD92DDF68C7002221D8 /* CouponViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CouponViewController.swift; sourceTree = "<group>"; };
......@@ -327,6 +331,15 @@
name = Fonts;
sourceTree = "<group>";
};
1E64E1802DE48DD600543217 /* MyRewardsOfferCollectionViewCell */ = {
isa = PBXGroup;
children = (
1E64E1812DE48E0600543217 /* MyRewardsOfferCollectionViewCell.swift */,
1E64E1822DE48E0600543217 /* MyRewardsOfferCollectionViewCell.xib */,
);
path = MyRewardsOfferCollectionViewCell;
sourceTree = "<group>";
};
1E917CD32DDF6472002221D8 /* MyRewardsViewController */ = {
isa = PBXGroup;
children = (
......@@ -368,6 +381,7 @@
1EA8E5BC2DDF34FB00CD3418 /* cells */ = {
isa = PBXGroup;
children = (
1E64E1802DE48DD600543217 /* MyRewardsOfferCollectionViewCell */,
1ED41E492DE0C21800836ABA /* MyRewardsBannerOfferCollectionViewCell */,
1EB4F4282DE0A09500D934C0 /* MyRewardsOffersScrollTableViewCell */,
1EB4F4222DE09A4300D934C0 /* MyRewardsBannerOffersScrollTableViewCell */,
......@@ -822,6 +836,7 @@
E6A77905282933E60045BBA8 /* warp_white_back_button@2x.png in Resources */,
1EB4F4252DE09AAC00D934C0 /* MyRewardsBannerOffersScrollTableViewCell.xib in Resources */,
1EA8E5C02DDF427A00CD3418 /* PingLCG-Bold.otf in Resources */,
1E64E1832DE48E0600543217 /* MyRewardsOfferCollectionViewCell.xib in Resources */,
1EA8E5C12DDF427A00CD3418 /* PingLCG-Light.otf in Resources */,
1EA8E5C22DDF427A00CD3418 /* PingLCG-Regular.otf in Resources */,
E6A77908282933E60045BBA8 /* warp_white_close_button@2x.png in Resources */,
......@@ -886,6 +901,7 @@
E6A77954282933E70045BBA8 /* MyApi.m in Sources */,
E6A778F2282933E60045BBA8 /* WLNativeAdCollectionViewCell.m in Sources */,
E6A77904282933E60045BBA8 /* WLEvent.m in Sources */,
1E64E1842DE48E0600543217 /* MyRewardsOfferCollectionViewCell.swift in Sources */,
E6A77927282933E70045BBA8 /* UIRefreshControl+AFNetworking.m in Sources */,
E6A77955282933E70045BBA8 /* ViewControllerExtensions.swift in Sources */,
A07936762885E9CC00064122 /* UIColorExtensions.swift in Sources */,
......
{
"images" : [
{
"filename" : "avis_banner.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "avis_banner 1.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "avis_banner 2.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "avis_logo.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "avis_logo 1.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "avis_logo 2.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "coffeeisland_banner.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "coffeeisland_banner 1.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "coffeeisland_banner 2.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "coffeeisland_logo.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "coffeeisland_logo 1.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "coffeeisland_logo 2.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "dominos_banner.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "dominos_banner 1.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "dominos_banner 2.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "dominos_logo.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "dominos_logo 1.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "dominos_logo 2.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "favorite_empty.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "favorite_empty 1.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "favorite_empty 2.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "favorite_filled.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "favorite_filled 1.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "favorite_filled 2.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "migato_banner.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "migato_banner 1.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "migato_banner 2.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "migato_logo.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "migato_logo 1.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "migato_logo 2.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "moustakas_banner.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "moustakas_banner 1.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "moustakas_banner 2.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "moustakas_logo.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "moustakas_logo 1.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "moustakas_logo 2.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "musa_banner.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "musa_banner 1.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "musa_banner 2.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "musa_logo.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "musa_logo 1.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "musa_logo 2.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "ninemia_banner.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ninemia_banner 1.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ninemia_banner 2.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "ninemia_logo.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ninemia_logo 1.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ninemia_logo 2.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "ranch_banner.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ranch_banner 1.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ranch_banner 2.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "ranch_logo.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ranch_logo 1.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ranch_logo 2.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "zuccherino_banner.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "zuccherino_banner 1.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "zuccherino_banner 2.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "zuccherino_logo.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "zuccherino_logo 1.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "zuccherino_logo 2.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
//
// MyRewardsOfferCollectionViewCell.swift
// SwiftWarplyFramework
//
// Created by Manos Chorianopoulos on 26/5/25.
//
import UIKit
@objc public class MyRewardsOfferCollectionViewCell: UICollectionViewCell {
@IBOutlet weak var parentView: UIView!
@IBOutlet weak var bannerImage: UIImageView!
@IBOutlet weak var favoriteImage: UIImageView!
@IBOutlet weak var discountView: UIView!
@IBOutlet weak var discountLabel: UILabel!
@IBOutlet weak var titleLabel: UILabel!
@IBOutlet weak var subtitleLabel: UILabel!
@IBOutlet weak var expirationLabel: UILabel!
@IBOutlet weak var logoImage: UIImageView!
public override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
parentView.layer.borderWidth = 1.0
parentView.layer.borderColor = UIColor(rgb: 0xCCCCCC).cgColor
parentView.layer.cornerRadius = 8.0
discountView.layer.cornerRadius = 34.0
}
func configureCell(data: OfferModel) {
bannerImage.image = UIImage(named: data.bannerImage, in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
favoriteImage.image = UIImage(named: data.isFavorite ? "favorite_filled" : "favorite_empty", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
let discountSymbol =
data.discountType == "percentage" ? "%"
: data.discountType == "price" ? "€"
: data.discountType == "buyOneGetOne" ? "1+1"
: data.discountType == "free" ? "Δωρεάν"
: ""
discountLabel.text = "\(data.discount)\(discountSymbol)"
discountLabel.font = UIFont(name: "PingLCG-Bold", size: 18)
discountLabel.textColor = UIColor(rgb: 0xF2F2F2)
discountView.backgroundColor = UIColor(rgb: data.color)
titleLabel.text = data.title
titleLabel.font = UIFont(name: "PingLCG-Bold", size: 17)
titleLabel.textColor = UIColor(rgb: 0x000F1E)
subtitleLabel.text = data.description
subtitleLabel.font = UIFont(name: "PingLCG-Regular", size: 14)
subtitleLabel.textColor = UIColor(rgb: 0x00111B)
expirationLabel.text = data.expirationDate
expirationLabel.font = UIFont(name: "PingLCG-Regular", size: 13)
expirationLabel.textColor = UIColor(rgb: 0x00111B)
logoImage.image = UIImage(named: data.merchantLogo, in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
}
}
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23094" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23084"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="gTV-IL-0wX" customClass="MyRewardsOfferCollectionViewCell" customModule="SwiftWarplyFramework" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="268" height="165"/>
<autoresizingMask key="autoresizingMask"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="0.0" y="0.0" width="268" height="165"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="5If-VV-K9F" userLabel="Content View">
<rect key="frame" x="0.0" y="0.0" width="268" height="165"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="nG0-KL-IyC" userLabel="Top View">
<rect key="frame" x="0.0" y="0.0" width="268" height="64"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="gqm-4L-lda">
<rect key="frame" x="0.0" y="0.0" width="268" height="64"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</imageView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="QOx-tV-FfU" userLabel="Fav View">
<rect key="frame" x="11" y="11" width="32" height="32"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="ejc-b5-x4O">
<rect key="frame" x="0.0" y="0.0" width="32" height="32"/>
</imageView>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="ejc-b5-x4O" secondAttribute="bottom" id="1dH-yH-qh5"/>
<constraint firstAttribute="width" constant="32" id="4pY-UM-gMO"/>
<constraint firstAttribute="height" constant="32" id="DU3-At-Mer"/>
<constraint firstItem="ejc-b5-x4O" firstAttribute="top" secondItem="QOx-tV-FfU" secondAttribute="top" id="OX3-hg-gxs"/>
<constraint firstAttribute="trailing" secondItem="ejc-b5-x4O" secondAttribute="trailing" id="bf8-Ox-3RY"/>
<constraint firstItem="ejc-b5-x4O" firstAttribute="leading" secondItem="QOx-tV-FfU" secondAttribute="leading" id="liF-N2-Su9"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ke4-P2-jW4" userLabel="Discount View">
<rect key="frame" x="192" y="6" width="68" height="68"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dlB-Ci-f8K">
<rect key="frame" x="5" y="23.666666666666671" width="58" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="dlB-Ci-f8K" secondAttribute="trailing" constant="5" id="0Tq-Li-agp"/>
<constraint firstItem="dlB-Ci-f8K" firstAttribute="leading" secondItem="ke4-P2-jW4" secondAttribute="leading" constant="5" id="117-Tu-LJK"/>
<constraint firstAttribute="height" constant="68" id="Khe-02-FI3"/>
<constraint firstItem="dlB-Ci-f8K" firstAttribute="centerY" secondItem="ke4-P2-jW4" secondAttribute="centerY" id="aeh-X3-24S"/>
<constraint firstAttribute="width" constant="68" id="shl-u3-3uB"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="QOx-tV-FfU" firstAttribute="top" secondItem="nG0-KL-IyC" secondAttribute="top" constant="11" id="4zB-vJ-bf2"/>
<constraint firstItem="QOx-tV-FfU" firstAttribute="leading" secondItem="nG0-KL-IyC" secondAttribute="leading" constant="11" id="AmT-7g-TDI"/>
<constraint firstAttribute="trailing" secondItem="gqm-4L-lda" secondAttribute="trailing" id="CLQ-8R-3v5"/>
<constraint firstItem="gqm-4L-lda" firstAttribute="leading" secondItem="nG0-KL-IyC" secondAttribute="leading" id="DMQ-RI-Dqo"/>
<constraint firstAttribute="bottom" secondItem="gqm-4L-lda" secondAttribute="bottom" id="IXr-0J-fEF"/>
<constraint firstItem="ke4-P2-jW4" firstAttribute="top" secondItem="nG0-KL-IyC" secondAttribute="top" constant="6" id="T5E-w8-e65"/>
<constraint firstAttribute="trailing" secondItem="ke4-P2-jW4" secondAttribute="trailing" constant="8" id="VcX-22-qep"/>
<constraint firstItem="gqm-4L-lda" firstAttribute="top" secondItem="nG0-KL-IyC" secondAttribute="top" id="rzs-LV-a8h"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="VZh-nd-i9h" userLabel="Bottom View">
<rect key="frame" x="14" y="64" width="254" height="101"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="0lx-ek-fAp">
<rect key="frame" x="11" y="8" width="148" height="82"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="JDi-AY-Oai">
<rect key="frame" x="0.0" y="0.0" width="148" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="aNz-HU-dYm">
<rect key="frame" x="0.0" y="23" width="148" height="20.333333333333329"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bIt-Gd-bbg">
<rect key="frame" x="0.0" y="61" width="148" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="aNz-HU-dYm" firstAttribute="leading" secondItem="0lx-ek-fAp" secondAttribute="leading" id="8qd-OV-cVK"/>
<constraint firstAttribute="trailing" secondItem="bIt-Gd-bbg" secondAttribute="trailing" id="ANc-af-4O6"/>
<constraint firstAttribute="trailing" secondItem="aNz-HU-dYm" secondAttribute="trailing" id="Ezo-zF-W2F"/>
<constraint firstItem="aNz-HU-dYm" firstAttribute="top" secondItem="JDi-AY-Oai" secondAttribute="bottom" constant="2" id="MXk-Ps-ltc"/>
<constraint firstItem="bIt-Gd-bbg" firstAttribute="leading" secondItem="0lx-ek-fAp" secondAttribute="leading" id="Zb6-Vg-OH8"/>
<constraint firstAttribute="bottom" secondItem="bIt-Gd-bbg" secondAttribute="bottom" id="a0i-bg-TcH"/>
<constraint firstAttribute="trailing" secondItem="JDi-AY-Oai" secondAttribute="trailing" id="g3w-US-YLe"/>
<constraint firstItem="JDi-AY-Oai" firstAttribute="leading" secondItem="0lx-ek-fAp" secondAttribute="leading" id="leM-fr-NSp"/>
<constraint firstItem="JDi-AY-Oai" firstAttribute="top" secondItem="0lx-ek-fAp" secondAttribute="top" id="w9N-lK-j12"/>
</constraints>
</view>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="3me-Qd-ALg">
<rect key="frame" x="177" y="13" width="59" height="59"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="59" id="Ij1-x5-I27"/>
<constraint firstAttribute="width" constant="59" id="mF8-ON-pDd"/>
</constraints>
</imageView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="0lx-ek-fAp" secondAttribute="bottom" constant="11" id="2fO-c7-8Tu"/>
<constraint firstAttribute="trailing" secondItem="3me-Qd-ALg" secondAttribute="trailing" constant="18" id="Cz1-Kr-217"/>
<constraint firstItem="3me-Qd-ALg" firstAttribute="leading" secondItem="0lx-ek-fAp" secondAttribute="trailing" constant="18" id="EuN-os-tZW"/>
<constraint firstItem="0lx-ek-fAp" firstAttribute="leading" secondItem="VZh-nd-i9h" secondAttribute="leading" constant="11" id="RnP-Ni-5Af"/>
<constraint firstItem="0lx-ek-fAp" firstAttribute="top" secondItem="VZh-nd-i9h" secondAttribute="top" constant="8" id="WBh-0n-aCZ"/>
<constraint firstAttribute="height" constant="101" id="n4I-v3-1hF"/>
<constraint firstItem="3me-Qd-ALg" firstAttribute="top" secondItem="VZh-nd-i9h" secondAttribute="top" constant="13" id="uCb-Pr-pXa"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="VZh-nd-i9h" secondAttribute="bottom" id="0Kf-vE-Wru"/>
<constraint firstAttribute="trailing" secondItem="nG0-KL-IyC" secondAttribute="trailing" id="3PK-aE-vjr"/>
<constraint firstItem="VZh-nd-i9h" firstAttribute="top" secondItem="nG0-KL-IyC" secondAttribute="bottom" id="7xf-0u-A8S"/>
<constraint firstItem="VZh-nd-i9h" firstAttribute="leading" secondItem="5If-VV-K9F" secondAttribute="leading" constant="14" id="P5a-2H-UoS"/>
<constraint firstAttribute="trailing" secondItem="VZh-nd-i9h" secondAttribute="trailing" id="dzM-oX-xd7"/>
<constraint firstItem="nG0-KL-IyC" firstAttribute="top" secondItem="5If-VV-K9F" secondAttribute="top" id="l7a-R3-Wjx"/>
<constraint firstItem="nG0-KL-IyC" firstAttribute="leading" secondItem="5If-VV-K9F" secondAttribute="leading" id="vz8-lp-dsA"/>
</constraints>
</view>
</subviews>
</view>
<viewLayoutGuide key="safeArea" id="ZTg-uK-7eu"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="5If-VV-K9F" secondAttribute="trailing" id="21k-Bp-9O4"/>
<constraint firstItem="5If-VV-K9F" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" id="358-Xe-h2e"/>
<constraint firstAttribute="bottom" secondItem="5If-VV-K9F" secondAttribute="bottom" id="7k0-yl-lNT"/>
<constraint firstItem="5If-VV-K9F" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" id="Lxt-A4-pdv"/>
</constraints>
<size key="customSize" width="268" height="165"/>
<connections>
<outlet property="bannerImage" destination="gqm-4L-lda" id="WN0-B1-HnE"/>
<outlet property="discountLabel" destination="dlB-Ci-f8K" id="61M-80-ZVn"/>
<outlet property="discountView" destination="ke4-P2-jW4" id="D3r-DU-k8r"/>
<outlet property="expirationLabel" destination="bIt-Gd-bbg" id="N5o-l5-BQT"/>
<outlet property="favoriteImage" destination="ejc-b5-x4O" id="7At-Oz-6oi"/>
<outlet property="logoImage" destination="3me-Qd-ALg" id="2CP-5c-EOZ"/>
<outlet property="parentView" destination="5If-VV-K9F" id="rf7-LY-eKM"/>
<outlet property="subtitleLabel" destination="aNz-HU-dYm" id="rVw-x5-n1G"/>
<outlet property="titleLabel" destination="JDi-AY-Oai" id="Vm0-vf-hgz"/>
</connections>
<point key="canvasLocation" x="151.14503816793894" y="29.225352112676056"/>
</collectionViewCell>
</objects>
<resources>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>
......@@ -8,11 +8,57 @@
import UIKit
@objc public class MyRewardsOffersScrollTableViewCell: UITableViewCell {
var section: SectionModel?
@IBOutlet weak var categoryLabel: UILabel!
@IBOutlet weak var allButtonView: UIView!
@IBOutlet weak var allButtonLabel: UILabel!
@IBOutlet weak var collectionView: UICollectionView!
var data: SectionModel?
public override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
allButtonView.layer.borderWidth = 1.0
allButtonView.layer.borderColor = UIColor(rgb: 0x000F1E).cgColor
allButtonView.layer.cornerRadius = 4.0
allButtonLabel.text = "Όλα"
allButtonLabel.font = UIFont(name: "PingLCG-Regular", size: 16)
allButtonLabel.textColor = UIColor(rgb: 0x00111B)
// Register XIBs for collection view cells
collectionView.register(UINib(nibName: "MyRewardsBannerOfferCollectionViewCell", bundle: Bundle(for: MyEmptyClass.self)), forCellWithReuseIdentifier: "MyRewardsBannerOfferCollectionViewCell")
// Fix background colors
collectionView.backgroundColor = UIColor.clear
self.backgroundColor = UIColor.clear
self.contentView.backgroundColor = UIColor.clear
// Remove content insets and gaps
collectionView.contentInset = UIEdgeInsets.zero
collectionView.scrollIndicatorInsets = UIEdgeInsets.zero
if #available(iOS 11.0, *) {
collectionView.contentInsetAdjustmentBehavior = .never
}
// Configure collection view layout
if let layout = collectionView.collectionViewLayout as? UICollectionViewFlowLayout {
layout.scrollDirection = .horizontal
layout.minimumLineSpacing = 0
layout.minimumInteritemSpacing = 0
layout.sectionInset = UIEdgeInsets.zero
}
// Enable paging for smooth banner scrolling
collectionView.isPagingEnabled = true
collectionView.showsHorizontalScrollIndicator = false
// Set delegates
collectionView.delegate = self
collectionView.dataSource = self
}
public override func setSelected(_ selected: Bool, animated: Bool) {
......@@ -23,5 +69,73 @@ import UIKit
func configureCell(data: SectionModel?) {
// struct SectionModel {
// let title: String
// let count: Int
// let offers: [OfferModel]
// }
self.data = data
let catBoldText = (data?.title ?? "") + " "
let catRegText = String(data?.count ?? 0)
let attrBold = [NSAttributedString.Key.font : UIFont(name: "PingLCG-Bold", size: 18) ?? UIFont.boldSystemFont(ofSize: 17), NSAttributedString.Key.foregroundColor: UIColor(rgb: 0x000F1E)]
let attrRegular = [NSAttributedString.Key.font : UIFont(name: "PingLCG-Regular", size: 18) ?? UIFont.systemFont(ofSize: 17), NSAttributedString.Key.foregroundColor: UIColor(rgb: 0x000F1E)]
let catAttributedString = NSMutableAttributedString(string:catBoldText, attributes:attrBold)
let catRegString = NSMutableAttributedString(string: catRegText, attributes:attrRegular)
catAttributedString.append(catRegString)
categoryLabel.attributedText = catAttributedString
self.collectionView.reloadData();
}
}
extension MyRewardsOffersScrollTableViewCell: UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout {
public func numberOfSections(in collectionView: UICollectionView) -> Int {
return 1
}
public func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return self.data?.offers.count ?? 0
}
public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "MyRewardsBannerOfferCollectionViewCell", for: indexPath) as! MyRewardsBannerOfferCollectionViewCell
// cell.configureCell(offer: self.data?.offers[indexPath.row])
if let offer = self.data?.offers[indexPath.row] {
cell.configureCell(data: offer)
}
return cell;
}
public func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
// TODO: open offer
}
// MARK: - UICollectionViewDelegateFlowLayout
public func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
// let screenWidth = UIScreen.main.bounds.width
return CGSize(width: 257, height: 232)
}
// Distance Between Item Cells
public func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat {
return 7
}
public func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat {
return 0
}
// Cell Margin
public func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets {
return UIEdgeInsets.zero
// UIEdgeInsets(top: 0, left: 7, bottom: 0, right: 0)
}
}
......
......@@ -9,16 +9,114 @@
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="MyRewardsOffersScrollTableViewCell" id="KGk-i7-Jjw" customClass="MyRewardsOffersScrollTableViewCell" customModule="SwiftWarplyFramework" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="MyRewardsOffersScrollTableViewCell" rowHeight="265" id="KGk-i7-Jjw" customClass="MyRewardsOffersScrollTableViewCell" customModule="SwiftWarplyFramework" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="403" height="265"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" ambiguous="YES" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
<rect key="frame" x="0.0" y="0.0" width="403" height="265"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<view contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="3yR-f0-cq6" userLabel="Parent View">
<rect key="frame" x="0.0" y="-127" width="403" height="298"/>
<subviews>
<view contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="iQa-jk-pTS" userLabel="Top View">
<rect key="frame" x="24" y="60" width="355" height="35"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="2GN-Th-7DN">
<rect key="frame" x="0.0" y="7" width="270" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="9Qp-M4-KdO">
<rect key="frame" x="280" y="0.0" width="75" height="35"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Όλα" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="KGA-M6-mox">
<rect key="frame" x="17" y="7" width="41" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="3xd-DO-x7D">
<rect key="frame" x="0.0" y="0.0" width="75" height="35"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="plain" title="Button">
<color key="baseForegroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</buttonConfiguration>
</button>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="3xd-DO-x7D" secondAttribute="trailing" id="JPz-In-GKK"/>
<constraint firstItem="3xd-DO-x7D" firstAttribute="top" secondItem="9Qp-M4-KdO" secondAttribute="top" id="Tja-OQ-C2l"/>
<constraint firstItem="KGA-M6-mox" firstAttribute="leading" secondItem="9Qp-M4-KdO" secondAttribute="leading" constant="17" id="VmX-L4-pUZ"/>
<constraint firstItem="KGA-M6-mox" firstAttribute="top" secondItem="9Qp-M4-KdO" secondAttribute="top" constant="7" id="Wfv-az-eWF"/>
<constraint firstItem="3xd-DO-x7D" firstAttribute="leading" secondItem="9Qp-M4-KdO" secondAttribute="leading" id="a6e-3u-98H"/>
<constraint firstAttribute="bottom" secondItem="KGA-M6-mox" secondAttribute="bottom" constant="7" id="e7a-OL-xbA"/>
<constraint firstAttribute="trailing" secondItem="KGA-M6-mox" secondAttribute="trailing" constant="17" id="eK1-vy-dDM"/>
<constraint firstAttribute="bottom" secondItem="3xd-DO-x7D" secondAttribute="bottom" id="xGA-AA-7JP"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="9Qp-M4-KdO" secondAttribute="bottom" id="DJk-cb-lzX"/>
<constraint firstAttribute="trailing" secondItem="9Qp-M4-KdO" secondAttribute="trailing" id="E5b-4E-onH"/>
<constraint firstItem="9Qp-M4-KdO" firstAttribute="leading" secondItem="2GN-Th-7DN" secondAttribute="trailing" constant="10" id="ESz-J3-ppp"/>
<constraint firstItem="9Qp-M4-KdO" firstAttribute="top" secondItem="iQa-jk-pTS" secondAttribute="top" id="GyS-sa-4pe"/>
<constraint firstItem="2GN-Th-7DN" firstAttribute="centerY" secondItem="iQa-jk-pTS" secondAttribute="centerY" id="ZIk-to-Cme"/>
<constraint firstItem="2GN-Th-7DN" firstAttribute="leading" secondItem="iQa-jk-pTS" secondAttribute="leading" id="j55-YX-1uu"/>
</constraints>
</view>
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" ambiguous="YES" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" dataMode="none" translatesAutoresizingMaskIntoConstraints="NO" id="E9Q-uB-Uvd">
<rect key="frame" x="0.0" y="100" width="403" height="232"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="232" id="kSx-su-PE4"/>
</constraints>
<collectionViewFlowLayout key="collectionViewLayout" scrollDirection="horizontal" automaticEstimatedItemSize="YES" minimumLineSpacing="5" minimumInteritemSpacing="5" id="fEo-FG-gpQ">
<size key="itemSize" width="128" height="120"/>
<size key="headerReferenceSize" width="0.0" height="0.0"/>
<size key="footerReferenceSize" width="0.0" height="0.0"/>
<inset key="sectionInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
</collectionViewFlowLayout>
<cells/>
<connections>
<outlet property="dataSource" destination="KGk-i7-Jjw" id="jxz-Rh-IWI"/>
<outlet property="delegate" destination="KGk-i7-Jjw" id="Kbe-g1-Imx"/>
</connections>
</collectionView>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="E9Q-uB-Uvd" firstAttribute="top" secondItem="iQa-jk-pTS" secondAttribute="bottom" constant="5" id="BbT-IJ-sg4"/>
<constraint firstItem="iQa-jk-pTS" firstAttribute="leading" secondItem="3yR-f0-cq6" secondAttribute="leading" constant="24" id="C0X-4S-oP1"/>
<constraint firstAttribute="trailing" secondItem="E9Q-uB-Uvd" secondAttribute="trailing" id="KNV-Sk-0rr"/>
<constraint firstItem="iQa-jk-pTS" firstAttribute="top" secondItem="3yR-f0-cq6" secondAttribute="top" constant="60" id="Saf-QC-O71"/>
<constraint firstItem="E9Q-uB-Uvd" firstAttribute="leading" secondItem="3yR-f0-cq6" secondAttribute="leading" id="ToF-ce-EMM"/>
<constraint firstAttribute="bottom" secondItem="E9Q-uB-Uvd" secondAttribute="bottom" id="ssj-8N-2gP"/>
<constraint firstAttribute="trailing" secondItem="iQa-jk-pTS" secondAttribute="trailing" constant="24" id="zI6-rP-3kk"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="3yR-f0-cq6" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="DsP-BH-dA4"/>
<constraint firstAttribute="bottom" secondItem="3yR-f0-cq6" secondAttribute="bottom" id="F3o-0K-6MW"/>
<constraint firstItem="3yR-f0-cq6" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" id="ezZ-G1-pq2"/>
<constraint firstAttribute="trailing" secondItem="3yR-f0-cq6" secondAttribute="trailing" id="nH3-Xd-I3V"/>
</constraints>
</tableViewCellContentView>
<viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<point key="canvasLocation" x="37" y="-11"/>
<connections>
<outlet property="allButtonLabel" destination="KGA-M6-mox" id="34J-92-2Fb"/>
<outlet property="allButtonView" destination="9Qp-M4-KdO" id="dwb-fV-WAm"/>
<outlet property="categoryLabel" destination="2GN-Th-7DN" id="wGT-fB-Ktd"/>
<outlet property="collectionView" destination="E9Q-uB-Uvd" id="qi5-nL-UzB"/>
</connections>
<point key="canvasLocation" x="-69.465648854961827" y="-23.591549295774648"/>
</tableViewCell>
</objects>
</document>
......
......@@ -22,7 +22,7 @@ struct OfferModel {
let bannerImage: String
let merchantLogo: String
let expirationDate: String
let color: String
let color: UInt
var isFavorite: Bool
}
......@@ -41,7 +41,7 @@ struct OfferModel {
bannerImage: "contest_banner",
merchantLogo: "contest_logo",
expirationDate: "30/06/2025",
color: "#8A2BE2", // Purple
color: 0x8A2BE2,
isFavorite: false
),
OfferModel(
......@@ -53,7 +53,7 @@ struct OfferModel {
bannerImage: "contest_banner",
merchantLogo: "contest_logo",
expirationDate: "30/06/2025",
color: "#8A2BE2", // Purple
color: 0x8A2BE2,
isFavorite: false
),
OfferModel(
......@@ -65,7 +65,7 @@ struct OfferModel {
bannerImage: "contest_banner",
merchantLogo: "contest_logo",
expirationDate: "30/06/2025",
color: "#8A2BE2", // Purple
color: 0x8A2BE2,
isFavorite: false
),
// Top offers
......@@ -78,7 +78,7 @@ struct OfferModel {
bannerImage: "pizza_banner",
merchantLogo: "dominos_logo",
expirationDate: "έως 30/09",
color: "#E91E63", // Pink
color: 0xEE417D,
isFavorite: true
),
OfferModel(
......@@ -90,7 +90,7 @@ struct OfferModel {
bannerImage: "furniture_banner",
merchantLogo: "ikea_logo",
expirationDate: "έως 30/09",
color: "#E91E63", // Pink
color: 0xEE417D,
isFavorite: false
),
// OfferModel(
......@@ -102,7 +102,7 @@ struct OfferModel {
// bannerImage: "delivery_banner",
// merchantLogo: "skroutz_logo",
// expirationDate: "έως 30/09",
// color: "#E91E63", // Pink
// color: 0xEE417D,
// isFavorite: false
// ),
......@@ -116,7 +116,7 @@ struct OfferModel {
// bannerImage: "car_rental_banner",
// merchantLogo: "avis_logo",
// expirationDate: "έως 30/09",
// color: "#E91E63", // Pink
// color: 0xEE417D,
// isFavorite: true
// ),
// OfferModel(
......@@ -128,7 +128,7 @@ struct OfferModel {
// bannerImage: "hotel_banner",
// merchantLogo: "booking_logo",
// expirationDate: "έως 30/09",
// color: "#E91E63", // Pink
// color: 0xEE417D,
// isFavorite: true
// ),
......@@ -139,10 +139,10 @@ struct OfferModel {
description: "σε όλα τα προϊόντα",
discount: "15%",
discountType: "percentage",
bannerImage: "sustainable_fashion_banner",
merchantLogo: "ww_logo",
bannerImage: "musa_banner",
merchantLogo: "musa_logo",
expirationDate: "έως 30/09",
color: "#4CAF50", // Green
color: 0x09914E,
isFavorite: false
),
OfferModel(
......@@ -151,10 +151,10 @@ struct OfferModel {
description: "στην παραγγελία",
discount: "20%",
discountType: "percentage",
bannerImage: "sustainable_food_banner",
merchantLogo: "biomarket_logo",
bannerImage: "musa_banner",
merchantLogo: "musa_logo",
expirationDate: "έως 30/09",
color: "#4CAF50", // Green
color: 0x09914E,
isFavorite: true
),
......@@ -168,7 +168,7 @@ struct OfferModel {
bannerImage: "ranch_banner",
merchantLogo: "ranch_logo",
expirationDate: "έως 30/09",
color: "#FF9800", // Orange
color: 0xFC9F25,
isFavorite: false
),
OfferModel(
......@@ -177,10 +177,10 @@ struct OfferModel {
description: "δώρο στην είσοδο του παιδότοπου",
discount: "1+1",
discountType: "buyOneGetOne",
bannerImage: "playground_banner",
merchantLogo: "playground_logo",
bannerImage: "ranch_banner",
merchantLogo: "ranch_logo",
expirationDate: "έως 30/09",
color: "#FF9800", // Orange
color: 0xFC9F25,
isFavorite: false
),
......@@ -191,10 +191,10 @@ struct OfferModel {
description: "στην αγορά σου",
discount: "2€",
discountType: "amount",
bannerImage: "coffee_banner",
merchantLogo: "mikel_logo",
bannerImage: "coffeeisland_banner",
merchantLogo: "coffeeisland_logo",
expirationDate: "έως 30/09",
color: "#F44336", // Red
color: 0xEE417D,
isFavorite: false
),
OfferModel(
......@@ -203,10 +203,10 @@ struct OfferModel {
description: "σε γλυκά & πεϊνιρλιδες",
discount: "10%",
discountType: "percentage",
bannerImage: "pastry_banner",
merchantLogo: "bakery_logo",
bannerImage: "coffeeisland_banner",
merchantLogo: "coffeeisland_logo",
expirationDate: "έως 30/09",
color: "#F44336", // Red
color: 0xEE417D,
isFavorite: false
),
......@@ -217,10 +217,10 @@ struct OfferModel {
description: "στην διαμονή/διασκέδαση σου",
discount: "10%",
discountType: "percentage",
bannerImage: "resort_banner",
merchantLogo: "agrafa_logo",
bannerImage: "ninemia_banner",
merchantLogo: "ninemia_logo",
expirationDate: "έως 30/09",
color: "#2196F3", // Blue
color: 0xEE417D,
isFavorite: true
),
OfferModel(
......@@ -229,10 +229,10 @@ struct OfferModel {
description: "σε όλες τις υπηρεσίες",
discount: "10%",
discountType: "percentage",
bannerImage: "services_banner",
merchantLogo: "services_logo",
bannerImage: "ninemia_banner",
merchantLogo: "ninemia_logo",
expirationDate: "έως 30/09",
color: "#2196F3", // Blue
color: 0xEE417D,
isFavorite: false
),
......@@ -243,10 +243,10 @@ struct OfferModel {
description: "για αγορές από τα φυσικά καταστήματα",
discount: "10%",
discountType: "percentage",
bannerImage: "toys_banner",
merchantLogo: "jumbo_logo",
bannerImage: "moustakas_banner",
merchantLogo: "moustakas_logo",
expirationDate: "έως 30/09",
color: "#9C27B0", // Purple
color: 0xEE417D,
isFavorite: false
),
OfferModel(
......@@ -255,10 +255,10 @@ struct OfferModel {
description: "στην είσοδο του παιδότοπου",
discount: "1+1",
discountType: "buyOneGetOne",
bannerImage: "playarea_banner",
merchantLogo: "playarea_logo",
bannerImage: "moustakas_banner",
merchantLogo: "moustakas_logo",
expirationDate: "έως 30/09",
color: "#9C27B0", // Purple
color: 0xEE417D,
isFavorite: false
),
......@@ -269,10 +269,10 @@ struct OfferModel {
description: "για αγορές",
discount: "15€",
discountType: "amount",
bannerImage: "fashion_banner",
bannerImage: "migato_banner",
merchantLogo: "migato_logo",
expirationDate: "έως 30/09",
color: "#FF5722", // Deep Orange
color: 0xEE417D,
isFavorite: false
),
OfferModel(
......@@ -281,10 +281,10 @@ struct OfferModel {
description: "στις αγορές σου",
discount: "Έως 30%",
discountType: "percentage",
bannerImage: "shopping_banner",
merchantLogo: "shopping_logo",
bannerImage: "migato_banner",
merchantLogo: "migato_logo",
expirationDate: "έως 30/09",
color: "#FF5722", // Deep Orange
color: 0xEE417D,
isFavorite: false
)
]
......