Manos Chorianopoulos

MyRewardsViewController part1

...@@ -17,6 +17,10 @@ ...@@ -17,6 +17,10 @@
17 1EA8E5C02DDF427A00CD3418 /* PingLCG-Bold.otf in Resources */ = {isa = PBXBuildFile; fileRef = 1EA8E5BD2DDF427A00CD3418 /* PingLCG-Bold.otf */; }; 17 1EA8E5C02DDF427A00CD3418 /* PingLCG-Bold.otf in Resources */ = {isa = PBXBuildFile; fileRef = 1EA8E5BD2DDF427A00CD3418 /* PingLCG-Bold.otf */; };
18 1EA8E5C12DDF427A00CD3418 /* PingLCG-Light.otf in Resources */ = {isa = PBXBuildFile; fileRef = 1EA8E5BE2DDF427A00CD3418 /* PingLCG-Light.otf */; }; 18 1EA8E5C12DDF427A00CD3418 /* PingLCG-Light.otf in Resources */ = {isa = PBXBuildFile; fileRef = 1EA8E5BE2DDF427A00CD3418 /* PingLCG-Light.otf */; };
19 1EA8E5C22DDF427A00CD3418 /* PingLCG-Regular.otf in Resources */ = {isa = PBXBuildFile; fileRef = 1EA8E5BF2DDF427A00CD3418 /* PingLCG-Regular.otf */; }; 19 1EA8E5C22DDF427A00CD3418 /* PingLCG-Regular.otf in Resources */ = {isa = PBXBuildFile; fileRef = 1EA8E5BF2DDF427A00CD3418 /* PingLCG-Regular.otf */; };
20 + 1EB4F4252DE09AAC00D934C0 /* MyRewardsBannerOffersScrollTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1EB4F4242DE09AAC00D934C0 /* MyRewardsBannerOffersScrollTableViewCell.xib */; };
21 + 1EB4F4262DE09AAC00D934C0 /* MyRewardsBannerOffersScrollTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EB4F4232DE09AAC00D934C0 /* MyRewardsBannerOffersScrollTableViewCell.swift */; };
22 + 1EB4F42B2DE0A0AF00D934C0 /* MyRewardsOffersScrollTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1EB4F42A2DE0A0AF00D934C0 /* MyRewardsOffersScrollTableViewCell.xib */; };
23 + 1EB4F42C2DE0A0AF00D934C0 /* MyRewardsOffersScrollTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EB4F4292DE0A0AF00D934C0 /* MyRewardsOffersScrollTableViewCell.swift */; };
20 1EBF5F072840E13F00B8B17F /* SwiftEventBus in Frameworks */ = {isa = PBXBuildFile; productRef = 1EBF5F062840E13F00B8B17F /* SwiftEventBus */; }; 24 1EBF5F072840E13F00B8B17F /* SwiftEventBus in Frameworks */ = {isa = PBXBuildFile; productRef = 1EBF5F062840E13F00B8B17F /* SwiftEventBus */; };
21 7630AD9A6242D60846D6750C /* Pods_SwiftWarplyFramework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C0D5F56DD4E5371A50AD2D87 /* Pods_SwiftWarplyFramework.framework */; }; 25 7630AD9A6242D60846D6750C /* Pods_SwiftWarplyFramework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C0D5F56DD4E5371A50AD2D87 /* Pods_SwiftWarplyFramework.framework */; };
22 A07936762885E9CC00064122 /* UIColorExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = A07936752885E9CC00064122 /* UIColorExtensions.swift */; }; 26 A07936762885E9CC00064122 /* UIColorExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = A07936752885E9CC00064122 /* UIColorExtensions.swift */; };
...@@ -151,6 +155,10 @@ ...@@ -151,6 +155,10 @@
151 1EA8E5BD2DDF427A00CD3418 /* PingLCG-Bold.otf */ = {isa = PBXFileReference; lastKnownFileType = file; name = "PingLCG-Bold.otf"; path = "fonts/PingLCG-Bold.otf"; sourceTree = "<group>"; }; 155 1EA8E5BD2DDF427A00CD3418 /* PingLCG-Bold.otf */ = {isa = PBXFileReference; lastKnownFileType = file; name = "PingLCG-Bold.otf"; path = "fonts/PingLCG-Bold.otf"; sourceTree = "<group>"; };
152 1EA8E5BE2DDF427A00CD3418 /* PingLCG-Light.otf */ = {isa = PBXFileReference; lastKnownFileType = file; name = "PingLCG-Light.otf"; path = "fonts/PingLCG-Light.otf"; sourceTree = "<group>"; }; 156 1EA8E5BE2DDF427A00CD3418 /* PingLCG-Light.otf */ = {isa = PBXFileReference; lastKnownFileType = file; name = "PingLCG-Light.otf"; path = "fonts/PingLCG-Light.otf"; sourceTree = "<group>"; };
153 1EA8E5BF2DDF427A00CD3418 /* PingLCG-Regular.otf */ = {isa = PBXFileReference; lastKnownFileType = file; name = "PingLCG-Regular.otf"; path = "fonts/PingLCG-Regular.otf"; sourceTree = "<group>"; }; 157 1EA8E5BF2DDF427A00CD3418 /* PingLCG-Regular.otf */ = {isa = PBXFileReference; lastKnownFileType = file; name = "PingLCG-Regular.otf"; path = "fonts/PingLCG-Regular.otf"; sourceTree = "<group>"; };
158 + 1EB4F4232DE09AAC00D934C0 /* MyRewardsBannerOffersScrollTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyRewardsBannerOffersScrollTableViewCell.swift; sourceTree = "<group>"; };
159 + 1EB4F4242DE09AAC00D934C0 /* MyRewardsBannerOffersScrollTableViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MyRewardsBannerOffersScrollTableViewCell.xib; sourceTree = "<group>"; };
160 + 1EB4F4292DE0A0AF00D934C0 /* MyRewardsOffersScrollTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyRewardsOffersScrollTableViewCell.swift; sourceTree = "<group>"; };
161 + 1EB4F42A2DE0A0AF00D934C0 /* MyRewardsOffersScrollTableViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MyRewardsOffersScrollTableViewCell.xib; sourceTree = "<group>"; };
154 A07936752885E9CC00064122 /* UIColorExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIColorExtensions.swift; sourceTree = "<group>"; }; 162 A07936752885E9CC00064122 /* UIColorExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIColorExtensions.swift; sourceTree = "<group>"; };
155 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>"; }; 163 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>"; };
156 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>"; }; 164 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>"; };
...@@ -290,6 +298,13 @@ ...@@ -290,6 +298,13 @@
290 /* End PBXFrameworksBuildPhase section */ 298 /* End PBXFrameworksBuildPhase section */
291 299
292 /* Begin PBXGroup section */ 300 /* Begin PBXGroup section */
301 + 1E00E6A22DDF71BD0012F164 /* models */ = {
302 + isa = PBXGroup;
303 + children = (
304 + );
305 + path = models;
306 + sourceTree = "<group>";
307 + };
293 1E108A8B28A3F8FF0008B8E7 /* Resources */ = { 308 1E108A8B28A3F8FF0008B8E7 /* Resources */ = {
294 isa = PBXGroup; 309 isa = PBXGroup;
295 children = ( 310 children = (
...@@ -349,10 +364,30 @@ ...@@ -349,10 +364,30 @@
349 1EA8E5BC2DDF34FB00CD3418 /* cells */ = { 364 1EA8E5BC2DDF34FB00CD3418 /* cells */ = {
350 isa = PBXGroup; 365 isa = PBXGroup;
351 children = ( 366 children = (
367 + 1EB4F4282DE0A09500D934C0 /* MyRewardsOffersScrollTableViewCell */,
368 + 1EB4F4222DE09A4300D934C0 /* MyRewardsBannerOffersScrollTableViewCell */,
352 ); 369 );
353 path = cells; 370 path = cells;
354 sourceTree = "<group>"; 371 sourceTree = "<group>";
355 }; 372 };
373 + 1EB4F4222DE09A4300D934C0 /* MyRewardsBannerOffersScrollTableViewCell */ = {
374 + isa = PBXGroup;
375 + children = (
376 + 1EB4F4232DE09AAC00D934C0 /* MyRewardsBannerOffersScrollTableViewCell.swift */,
377 + 1EB4F4242DE09AAC00D934C0 /* MyRewardsBannerOffersScrollTableViewCell.xib */,
378 + );
379 + path = MyRewardsBannerOffersScrollTableViewCell;
380 + sourceTree = "<group>";
381 + };
382 + 1EB4F4282DE0A09500D934C0 /* MyRewardsOffersScrollTableViewCell */ = {
383 + isa = PBXGroup;
384 + children = (
385 + 1EB4F4292DE0A0AF00D934C0 /* MyRewardsOffersScrollTableViewCell.swift */,
386 + 1EB4F42A2DE0A0AF00D934C0 /* MyRewardsOffersScrollTableViewCell.xib */,
387 + );
388 + path = MyRewardsOffersScrollTableViewCell;
389 + sourceTree = "<group>";
390 + };
356 98AD36FA62350CEABCD961A7 /* Frameworks */ = { 391 98AD36FA62350CEABCD961A7 /* Frameworks */ = {
357 isa = PBXGroup; 392 isa = PBXGroup;
358 children = ( 393 children = (
...@@ -402,6 +437,7 @@ ...@@ -402,6 +437,7 @@
402 1E108A9728A3FA9B0008B8E7 /* Info.plist */, 437 1E108A9728A3FA9B0008B8E7 /* Info.plist */,
403 1EA8E5B42DDF315600CD3418 /* screens */, 438 1EA8E5B42DDF315600CD3418 /* screens */,
404 1EA8E5BC2DDF34FB00CD3418 /* cells */, 439 1EA8E5BC2DDF34FB00CD3418 /* cells */,
440 + 1E00E6A22DDF71BD0012F164 /* models */,
405 1E108A8B28A3F8FF0008B8E7 /* Resources */, 441 1E108A8B28A3F8FF0008B8E7 /* Resources */,
406 A07936742885E96A00064122 /* utilities */, 442 A07936742885E96A00064122 /* utilities */,
407 E6A7785A282933E40045BBA8 /* Helpers */, 443 E6A7785A282933E40045BBA8 /* Helpers */,
...@@ -769,10 +805,12 @@ ...@@ -769,10 +805,12 @@
769 E6A778F3282933E60045BBA8 /* WLNativeAdTableViewCell.xib in Resources */, 805 E6A778F3282933E60045BBA8 /* WLNativeAdTableViewCell.xib in Resources */,
770 E6A77A38282BC3530045BBA8 /* Media.xcassets in Resources */, 806 E6A77A38282BC3530045BBA8 /* Media.xcassets in Resources */,
771 E6A77905282933E60045BBA8 /* warp_white_back_button@2x.png in Resources */, 807 E6A77905282933E60045BBA8 /* warp_white_back_button@2x.png in Resources */,
808 + 1EB4F4252DE09AAC00D934C0 /* MyRewardsBannerOffersScrollTableViewCell.xib in Resources */,
772 1EA8E5C02DDF427A00CD3418 /* PingLCG-Bold.otf in Resources */, 809 1EA8E5C02DDF427A00CD3418 /* PingLCG-Bold.otf in Resources */,
773 1EA8E5C12DDF427A00CD3418 /* PingLCG-Light.otf in Resources */, 810 1EA8E5C12DDF427A00CD3418 /* PingLCG-Light.otf in Resources */,
774 1EA8E5C22DDF427A00CD3418 /* PingLCG-Regular.otf in Resources */, 811 1EA8E5C22DDF427A00CD3418 /* PingLCG-Regular.otf in Resources */,
775 E6A77908282933E60045BBA8 /* warp_white_close_button@2x.png in Resources */, 812 E6A77908282933E60045BBA8 /* warp_white_close_button@2x.png in Resources */,
813 + 1EB4F42B2DE0A0AF00D934C0 /* MyRewardsOffersScrollTableViewCell.xib in Resources */,
776 1E917CDB2DDF68C7002221D8 /* CouponViewController.xib in Resources */, 814 1E917CDB2DDF68C7002221D8 /* CouponViewController.xib in Resources */,
777 E6A77909282933E60045BBA8 /* warp_white_forward_button@2x.png in Resources */, 815 E6A77909282933E60045BBA8 /* warp_white_forward_button@2x.png in Resources */,
778 E6A77906282933E60045BBA8 /* warp_white_forward_button.png in Resources */, 816 E6A77906282933E60045BBA8 /* warp_white_forward_button.png in Resources */,
...@@ -836,6 +874,7 @@ ...@@ -836,6 +874,7 @@
836 E6A77955282933E70045BBA8 /* ViewControllerExtensions.swift in Sources */, 874 E6A77955282933E70045BBA8 /* ViewControllerExtensions.swift in Sources */,
837 A07936762885E9CC00064122 /* UIColorExtensions.swift in Sources */, 875 A07936762885E9CC00064122 /* UIColorExtensions.swift in Sources */,
838 E6A7795A28293D390045BBA8 /* swiftApi.swift in Sources */, 876 E6A7795A28293D390045BBA8 /* swiftApi.swift in Sources */,
877 + 1EB4F42C2DE0A0AF00D934C0 /* MyRewardsOffersScrollTableViewCell.swift in Sources */,
839 E6A77935282933E70045BBA8 /* UIWebView+AFNetworking.m in Sources */, 878 E6A77935282933E70045BBA8 /* UIWebView+AFNetworking.m in Sources */,
840 E6A77925282933E70045BBA8 /* UIProgressView+AFNetworking.m in Sources */, 879 E6A77925282933E70045BBA8 /* UIProgressView+AFNetworking.m in Sources */,
841 E6A77944282933E70045BBA8 /* AFSecurityPolicy.m in Sources */, 880 E6A77944282933E70045BBA8 /* AFSecurityPolicy.m in Sources */,
...@@ -861,6 +900,7 @@ ...@@ -861,6 +900,7 @@
861 E6A77903282933E60045BBA8 /* WLAPSItem.m in Sources */, 900 E6A77903282933E60045BBA8 /* WLAPSItem.m in Sources */,
862 E6A7790B282933E60045BBA8 /* WLPushManager.m in Sources */, 901 E6A7790B282933E60045BBA8 /* WLPushManager.m in Sources */,
863 E6A77950282933E70045BBA8 /* FMResultSet.m in Sources */, 902 E6A77950282933E70045BBA8 /* FMResultSet.m in Sources */,
903 + 1EB4F4262DE09AAC00D934C0 /* MyRewardsBannerOffersScrollTableViewCell.swift in Sources */,
864 E6A77936282933E70045BBA8 /* AFAutoPurgingImageCache.m in Sources */, 904 E6A77936282933E70045BBA8 /* AFAutoPurgingImageCache.m in Sources */,
865 E6A778FF282933E60045BBA8 /* WLBeacon.m in Sources */, 905 E6A778FF282933E60045BBA8 /* WLBeacon.m in Sources */,
866 E6A7791A282933E60045BBA8 /* WLAPPActionHandler.m in Sources */, 906 E6A7791A282933E60045BBA8 /* WLAPPActionHandler.m in Sources */,
......
1 +{
2 + "images" : [
3 + {
4 + "filename" : "profile_pic_default.png",
5 + "idiom" : "universal",
6 + "scale" : "1x"
7 + },
8 + {
9 + "filename" : "profile_pic_default 1.png",
10 + "idiom" : "universal",
11 + "scale" : "2x"
12 + },
13 + {
14 + "filename" : "profile_pic_default 2.png",
15 + "idiom" : "universal",
16 + "scale" : "3x"
17 + }
18 + ],
19 + "info" : {
20 + "author" : "xcode",
21 + "version" : 1
22 + }
23 +}
1 +//
2 +// MyRewardsBannerOffersScrollTableViewCell.swift
3 +// SwiftWarplyFramework
4 +//
5 +// Created by Manos Chorianopoulos on 23/5/25.
6 +//
7 +
8 +import UIKit
9 +
10 +@objc public class MyRewardsBannerOffersScrollTableViewCell: UITableViewCell {
11 + @IBOutlet weak var tagView1: UIView!
12 + @IBOutlet weak var tagLabel1: UILabel!
13 + @IBOutlet weak var tagView2: UIView!
14 + @IBOutlet weak var tagLabel2: UILabel!
15 + @IBOutlet weak var profileImage: UIImageView!
16 +
17 + var section: SectionModel?
18 +
19 + public override func awakeFromNib() {
20 + super.awakeFromNib()
21 + // Initialization code
22 +
23 + profileImage.image = UIImage(named: "profile_pic_default", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
24 +
25 + tagView1.backgroundColor = UIColor(rgb: 0x09914E)
26 + tagView1.layer.cornerRadius = 4.0
27 + tagLabel1.font = UIFont(name: "PingLCG-Regular", size: 17)
28 + tagLabel1.textColor = UIColor(rgb: 0xFFFFFF)
29 +
30 + tagView2.backgroundColor = UIColor(rgb: 0xFC9F25)
31 + tagView2.layer.cornerRadius = 4.0
32 + tagLabel2.font = UIFont(name: "PingLCG-Regular", size: 17)
33 + tagLabel2.textColor = UIColor(rgb: 0xFFFFFF)
34 + }
35 +
36 + public override func setSelected(_ selected: Bool, animated: Bool) {
37 + super.setSelected(selected, animated: animated)
38 +
39 + // Configure the view for the selected state
40 + }
41 +
42 + func configureCell(data: SectionModel?) {
43 + self.section = data
44 + }
45 +}
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<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">
3 + <device id="retina6_12" orientation="portrait" appearance="light"/>
4 + <dependencies>
5 + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23084"/>
6 + <capability name="Safe area layout guides" minToolsVersion="9.0"/>
7 + <capability name="System colors in document resources" minToolsVersion="11.0"/>
8 + <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
9 + </dependencies>
10 + <objects>
11 + <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
12 + <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
13 + <tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="MyRewardsBannerOffersScrollTableViewCell" rowHeight="119" id="KGk-i7-Jjw" customClass="MyRewardsBannerOffersScrollTableViewCell" customModule="SwiftWarplyFramework" customModuleProvider="target">
14 + <rect key="frame" x="0.0" y="0.0" width="388" height="119"/>
15 + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
16 + <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" ambiguous="YES" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
17 + <rect key="frame" x="0.0" y="0.0" width="388" height="119"/>
18 + <autoresizingMask key="autoresizingMask"/>
19 + <subviews>
20 + <view contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="VzF-dQ-3Wa" userLabel="Parent View">
21 + <rect key="frame" x="0.0" y="0.0" width="388" height="298"/>
22 + <subviews>
23 + <view contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="JTs-J5-DO2" userLabel="Top View">
24 + <rect key="frame" x="24" y="36" width="340" height="43"/>
25 + <subviews>
26 + <view contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="h09-MS-XKy">
27 + <rect key="frame" x="128.33333333333334" y="8.6666666666666643" width="58" height="26"/>
28 + <subviews>
29 + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Green" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="4m7-JY-MDY">
30 + <rect key="frame" x="6" y="3" width="46" height="20"/>
31 + <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
32 + <fontDescription key="fontDescription" name="HelveticaNeue" family="Helvetica Neue" pointSize="17"/>
33 + <nil key="textColor"/>
34 + <nil key="highlightedColor"/>
35 + </label>
36 + </subviews>
37 + <color key="backgroundColor" red="0.035294117647058823" green="0.56862745098039214" blue="0.30588235294117649" alpha="1" colorSpace="calibratedRGB"/>
38 + <constraints>
39 + <constraint firstAttribute="bottom" secondItem="4m7-JY-MDY" secondAttribute="bottom" constant="3" id="lbW-sK-uoN"/>
40 + <constraint firstItem="4m7-JY-MDY" firstAttribute="leading" secondItem="h09-MS-XKy" secondAttribute="leading" constant="6" id="oRk-5c-ko2"/>
41 + <constraint firstAttribute="trailing" secondItem="4m7-JY-MDY" secondAttribute="trailing" constant="6" id="rOt-tf-dSS"/>
42 + <constraint firstItem="4m7-JY-MDY" firstAttribute="top" secondItem="h09-MS-XKy" secondAttribute="top" constant="3" id="tui-5x-ntO"/>
43 + </constraints>
44 + </view>
45 + <view contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="H5g-xq-68p">
46 + <rect key="frame" x="194.33333333333337" y="8.6666666666666643" width="61.666666666666629" height="26"/>
47 + <subviews>
48 + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Family" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="WN9-wM-hV8">
49 + <rect key="frame" x="5.9999999999999716" y="3" width="49.666666666666664" height="20"/>
50 + <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
51 + <fontDescription key="fontDescription" name="HelveticaNeue" family="Helvetica Neue" pointSize="17"/>
52 + <nil key="textColor"/>
53 + <nil key="highlightedColor"/>
54 + </label>
55 + </subviews>
56 + <color key="backgroundColor" red="0.9882352941176471" green="0.62352941176470589" blue="0.14509803921568626" alpha="1" colorSpace="calibratedRGB"/>
57 + <constraints>
58 + <constraint firstAttribute="bottom" secondItem="WN9-wM-hV8" secondAttribute="bottom" constant="3" id="12P-zS-ZRM"/>
59 + <constraint firstItem="WN9-wM-hV8" firstAttribute="leading" secondItem="H5g-xq-68p" secondAttribute="leading" constant="6" id="O5x-bk-yjz"/>
60 + <constraint firstAttribute="trailing" secondItem="WN9-wM-hV8" secondAttribute="trailing" constant="6" id="lnW-mb-d4H"/>
61 + <constraint firstItem="WN9-wM-hV8" firstAttribute="top" secondItem="H5g-xq-68p" secondAttribute="top" constant="3" id="pwW-Ed-yv2"/>
62 + </constraints>
63 + </view>
64 + <view contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="5cf-tr-Vjf">
65 + <rect key="frame" x="297" y="0.0" width="43" height="43"/>
66 + <subviews>
67 + <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="fZO-NB-UyL">
68 + <rect key="frame" x="0.0" y="0.0" width="43" height="43"/>
69 + <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
70 + <constraints>
71 + <constraint firstAttribute="width" constant="43" id="Obc-SE-A5u"/>
72 + <constraint firstAttribute="height" constant="43" id="lZJ-VG-4fl"/>
73 + </constraints>
74 + </imageView>
75 + </subviews>
76 + <color key="backgroundColor" systemColor="systemBackgroundColor"/>
77 + <constraints>
78 + <constraint firstItem="fZO-NB-UyL" firstAttribute="leading" secondItem="5cf-tr-Vjf" secondAttribute="leading" id="Bfw-5S-wqz"/>
79 + <constraint firstItem="fZO-NB-UyL" firstAttribute="top" secondItem="5cf-tr-Vjf" secondAttribute="top" id="WCt-TJ-XQc"/>
80 + <constraint firstAttribute="trailing" secondItem="fZO-NB-UyL" secondAttribute="trailing" id="Z0D-wE-fgE"/>
81 + <constraint firstAttribute="bottom" secondItem="fZO-NB-UyL" secondAttribute="bottom" id="nuy-88-N5B"/>
82 + </constraints>
83 + </view>
84 + </subviews>
85 + <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
86 + <constraints>
87 + <constraint firstItem="5cf-tr-Vjf" firstAttribute="top" secondItem="JTs-J5-DO2" secondAttribute="top" id="GGh-C1-OfA"/>
88 + <constraint firstItem="H5g-xq-68p" firstAttribute="centerY" secondItem="JTs-J5-DO2" secondAttribute="centerY" id="Lwo-5b-tgm"/>
89 + <constraint firstAttribute="trailing" secondItem="5cf-tr-Vjf" secondAttribute="trailing" id="PBw-4p-3qC"/>
90 + <constraint firstItem="5cf-tr-Vjf" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="H5g-xq-68p" secondAttribute="trailing" constant="8" id="Wot-lB-jmI"/>
91 + <constraint firstAttribute="bottom" secondItem="5cf-tr-Vjf" secondAttribute="bottom" id="geG-Wp-p9Z"/>
92 + <constraint firstItem="h09-MS-XKy" firstAttribute="centerY" secondItem="JTs-J5-DO2" secondAttribute="centerY" id="j5f-Os-TZ0"/>
93 + <constraint firstItem="H5g-xq-68p" firstAttribute="leading" secondItem="h09-MS-XKy" secondAttribute="trailing" constant="8" id="wqx-Hc-3YH"/>
94 + </constraints>
95 + </view>
96 + </subviews>
97 + <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
98 + <constraints>
99 + <constraint firstItem="JTs-J5-DO2" firstAttribute="top" secondItem="VzF-dQ-3Wa" secondAttribute="top" constant="36" id="Ac5-fx-J3w"/>
100 + <constraint firstItem="JTs-J5-DO2" firstAttribute="leading" secondItem="VzF-dQ-3Wa" secondAttribute="leading" constant="24" id="B98-id-FLf"/>
101 + <constraint firstAttribute="trailing" secondItem="JTs-J5-DO2" secondAttribute="trailing" constant="24" id="Rdi-FK-2Ft"/>
102 + <constraint firstAttribute="bottom" secondItem="JTs-J5-DO2" secondAttribute="bottom" constant="20" id="Ubp-Qg-xtv"/>
103 + </constraints>
104 + </view>
105 + </subviews>
106 + <constraints>
107 + <constraint firstItem="VzF-dQ-3Wa" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="7Ut-VE-YGv"/>
108 + <constraint firstAttribute="trailing" secondItem="VzF-dQ-3Wa" secondAttribute="trailing" id="Hic-ok-g96"/>
109 + <constraint firstItem="VzF-dQ-3Wa" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" id="PZE-CV-H0c"/>
110 + <constraint firstAttribute="bottom" secondItem="VzF-dQ-3Wa" secondAttribute="bottom" id="hVw-ot-Ywc"/>
111 + </constraints>
112 + </tableViewCellContentView>
113 + <viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
114 + <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
115 + <connections>
116 + <outlet property="profileImage" destination="fZO-NB-UyL" id="l05-qG-DJv"/>
117 + <outlet property="tagLabel1" destination="4m7-JY-MDY" id="Min-YW-AN2"/>
118 + <outlet property="tagLabel2" destination="WN9-wM-hV8" id="yWk-1S-4Zk"/>
119 + <outlet property="tagView1" destination="h09-MS-XKy" id="Hxa-cN-6i4"/>
120 + <outlet property="tagView2" destination="H5g-xq-68p" id="Vcv-Si-g68"/>
121 + </connections>
122 + <point key="canvasLocation" x="53.435114503816791" y="14.43661971830986"/>
123 + </tableViewCell>
124 + </objects>
125 + <resources>
126 + <systemColor name="systemBackgroundColor">
127 + <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
128 + </systemColor>
129 + </resources>
130 +</document>
1 +//
2 +// MyRewardsOffersScrollTableViewCell.swift
3 +// SwiftWarplyFramework
4 +//
5 +// Created by Manos Chorianopoulos on 23/5/25.
6 +//
7 +
8 +import UIKit
9 +
10 +@objc public class MyRewardsOffersScrollTableViewCell: UITableViewCell {
11 + var section: SectionModel?
12 +
13 + public override func awakeFromNib() {
14 + super.awakeFromNib()
15 + // Initialization code
16 + }
17 +
18 + public override func setSelected(_ selected: Bool, animated: Bool) {
19 + super.setSelected(selected, animated: animated)
20 +
21 + // Configure the view for the selected state
22 + }
23 +
24 + func configureCell(data: SectionModel?) {
25 +
26 + }
27 +}
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<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">
3 + <device id="retina6_12" orientation="portrait" appearance="light"/>
4 + <dependencies>
5 + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23084"/>
6 + <capability name="Safe area layout guides" minToolsVersion="9.0"/>
7 + <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
8 + </dependencies>
9 + <objects>
10 + <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
11 + <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
12 + <tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="MyRewardsOffersScrollTableViewCell" id="KGk-i7-Jjw" customClass="MyRewardsOffersScrollTableViewCell" customModule="SwiftWarplyFramework" customModuleProvider="target">
13 + <rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
14 + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
15 + <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
16 + <rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
17 + <autoresizingMask key="autoresizingMask"/>
18 + </tableViewCellContentView>
19 + <viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
20 + <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
21 + <point key="canvasLocation" x="37" y="-11"/>
22 + </tableViewCell>
23 + </objects>
24 +</document>
...@@ -7,23 +7,480 @@ ...@@ -7,23 +7,480 @@
7 7
8 import UIKit 8 import UIKit
9 9
10 -@objc public class MyRewardsViewController: UIViewController { 10 +struct SectionModel {
11 + let title: String
12 + let count: Int
13 + let offers: [OfferModel]
14 +}
15 +
16 +struct OfferModel {
17 + let category: String
18 + let title: String
19 + let description: String
20 + let discount: String
21 + let discountType: String // e.g., "price", "percentage", "free", "buyOneGetOne", etc.
22 + let bannerImage: String
23 + let merchantLogo: String
24 + let expirationDate: String
25 + let color: String
26 + var isFavorite: Bool
27 +}
11 28
29 +@objc public class MyRewardsViewController: UIViewController {
30 + @IBOutlet weak var tableView: UITableView!
31 +
32 + // MARK: - Dummy Data
33 + let allOffers: [OfferModel] = [
34 + // Banner Offers
35 + OfferModel(
36 + category: "Διαγωνισμός",
37 + title: "Διαγωνισμός Κού-πονς!",
38 + description: "13 Απίθανα ΔΩΡΑ σε περιμένουν!",
39 + discount: "",
40 + discountType: "contest",
41 + bannerImage: "contest_banner",
42 + merchantLogo: "contest_logo",
43 + expirationDate: "30/06/2025",
44 + color: "#8A2BE2", // Purple
45 + isFavorite: false
46 + ),
47 + OfferModel(
48 + category: "Διαγωνισμός",
49 + title: "Διαγωνισμός Κού-πονς!",
50 + description: "13 Απίθανα ΔΩΡΑ σε περιμένουν!",
51 + discount: "",
52 + discountType: "contest",
53 + bannerImage: "contest_banner",
54 + merchantLogo: "contest_logo",
55 + expirationDate: "30/06/2025",
56 + color: "#8A2BE2", // Purple
57 + isFavorite: false
58 + ),
59 + OfferModel(
60 + category: "Διαγωνισμός",
61 + title: "Διαγωνισμός Κού-πονς!",
62 + description: "13 Απίθανα ΔΩΡΑ σε περιμένουν!",
63 + discount: "",
64 + discountType: "contest",
65 + bannerImage: "contest_banner",
66 + merchantLogo: "contest_logo",
67 + expirationDate: "30/06/2025",
68 + color: "#8A2BE2", // Purple
69 + isFavorite: false
70 + ),
71 + // Top offers
72 + OfferModel(
73 + category: "Top offers",
74 + title: "Μόνο 17.95",
75 + description: "2 πίτσες & Coca-COLA 1,5lt",
76 + discount: "17.95€",
77 + discountType: "price",
78 + bannerImage: "pizza_banner",
79 + merchantLogo: "dominos_logo",
80 + expirationDate: "έως 30/09",
81 + color: "#E91E63", // Pink
82 + isFavorite: true
83 + ),
84 + OfferModel(
85 + category: "Top offers",
86 + title: "20% έκπτωση",
87 + description: "για όλες τις online αγορές σας",
88 + discount: "20%",
89 + discountType: "percentage",
90 + bannerImage: "furniture_banner",
91 + merchantLogo: "ikea_logo",
92 + expirationDate: "έως 30/09",
93 + color: "#E91E63", // Pink
94 + isFavorite: false
95 + ),
96 + // OfferModel(
97 + // category: "Top offers",
98 + // title: "Δωρεάν μεταφορικά",
99 + // description: "για αγορές άνω των 50€",
100 + // discount: "Δωρεάν",
101 + // discountType: "free",
102 + // bannerImage: "delivery_banner",
103 + // merchantLogo: "skroutz_logo",
104 + // expirationDate: "έως 30/09",
105 + // color: "#E91E63", // Pink
106 + // isFavorite: false
107 + // ),
108 +
109 + // Αγαπημένα
110 + // OfferModel(
111 + // category: "Αγαπημένα",
112 + // title: "15% έκπτωση",
113 + // description: "στην ενοικίαση αυτοκινήτου",
114 + // discount: "15%",
115 + // discountType: "percentage",
116 + // bannerImage: "car_rental_banner",
117 + // merchantLogo: "avis_logo",
118 + // expirationDate: "έως 30/09",
119 + // color: "#E91E63", // Pink
120 + // isFavorite: true
121 + // ),
122 + // OfferModel(
123 + // category: "Αγαπημένα",
124 + // title: "20€ έως και",
125 + // description: "έκπτωση στα πακέτα",
126 + // discount: "20€",
127 + // discountType: "amount",
128 + // bannerImage: "hotel_banner",
129 + // merchantLogo: "booking_logo",
130 + // expirationDate: "έως 30/09",
131 + // color: "#E91E63", // Pink
132 + // isFavorite: true
133 + // ),
134 +
135 + // Βιωσιμότητα
136 + OfferModel(
137 + category: "Βιωσιμότητα",
138 + title: "15% έκπτωση",
139 + description: "σε όλα τα προϊόντα",
140 + discount: "15%",
141 + discountType: "percentage",
142 + bannerImage: "sustainable_fashion_banner",
143 + merchantLogo: "ww_logo",
144 + expirationDate: "έως 30/09",
145 + color: "#4CAF50", // Green
146 + isFavorite: false
147 + ),
148 + OfferModel(
149 + category: "Βιωσιμότητα",
150 + title: "20% έκπτωση",
151 + description: "στην παραγγελία",
152 + discount: "20%",
153 + discountType: "percentage",
154 + bannerImage: "sustainable_food_banner",
155 + merchantLogo: "biomarket_logo",
156 + expirationDate: "έως 30/09",
157 + color: "#4CAF50", // Green
158 + isFavorite: true
159 + ),
160 +
161 + // Family
162 + OfferModel(
163 + category: "Family",
164 + title: "10% έκπτωση",
165 + description: "στην κατασκήνωση στο The Ranch",
166 + discount: "10%",
167 + discountType: "percentage",
168 + bannerImage: "ranch_banner",
169 + merchantLogo: "ranch_logo",
170 + expirationDate: "έως 30/09",
171 + color: "#FF9800", // Orange
172 + isFavorite: false
173 + ),
174 + OfferModel(
175 + category: "Family",
176 + title: "1+1 εισιτήριο",
177 + description: "δώρο στην είσοδο του παιδότοπου",
178 + discount: "1+1",
179 + discountType: "buyOneGetOne",
180 + bannerImage: "playground_banner",
181 + merchantLogo: "playground_logo",
182 + expirationDate: "έως 30/09",
183 + color: "#FF9800", // Orange
184 + isFavorite: false
185 + ),
186 +
187 + // Φαγητό και καφές
188 + OfferModel(
189 + category: "Φαγητό και καφές",
190 + title: "2€ έκπτωση",
191 + description: "στην αγορά σου",
192 + discount: "2€",
193 + discountType: "amount",
194 + bannerImage: "coffee_banner",
195 + merchantLogo: "mikel_logo",
196 + expirationDate: "έως 30/09",
197 + color: "#F44336", // Red
198 + isFavorite: false
199 + ),
200 + OfferModel(
201 + category: "Φαγητό και καφές",
202 + title: "10% έκπτωση",
203 + description: "σε γλυκά & πεϊνιρλιδες",
204 + discount: "10%",
205 + discountType: "percentage",
206 + bannerImage: "pastry_banner",
207 + merchantLogo: "bakery_logo",
208 + expirationDate: "έως 30/09",
209 + color: "#F44336", // Red
210 + isFavorite: false
211 + ),
212 +
213 + // Απόδραση
214 + OfferModel(
215 + category: "Απόδραση",
216 + title: "10% έκπτωση",
217 + description: "στην διαμονή/διασκέδαση σου",
218 + discount: "10%",
219 + discountType: "percentage",
220 + bannerImage: "resort_banner",
221 + merchantLogo: "agrafa_logo",
222 + expirationDate: "έως 30/09",
223 + color: "#2196F3", // Blue
224 + isFavorite: true
225 + ),
226 + OfferModel(
227 + category: "Απόδραση",
228 + title: "10% έκπτωση",
229 + description: "σε όλες τις υπηρεσίες",
230 + discount: "10%",
231 + discountType: "percentage",
232 + bannerImage: "services_banner",
233 + merchantLogo: "services_logo",
234 + expirationDate: "έως 30/09",
235 + color: "#2196F3", // Blue
236 + isFavorite: false
237 + ),
238 +
239 + // Παιδί
240 + OfferModel(
241 + category: "Παιδί",
242 + title: "10% έκπτωση",
243 + description: "για αγορές από τα φυσικά καταστήματα",
244 + discount: "10%",
245 + discountType: "percentage",
246 + bannerImage: "toys_banner",
247 + merchantLogo: "jumbo_logo",
248 + expirationDate: "έως 30/09",
249 + color: "#9C27B0", // Purple
250 + isFavorite: false
251 + ),
252 + OfferModel(
253 + category: "Παιδί",
254 + title: "1+1 Δώρο",
255 + description: "στην είσοδο του παιδότοπου",
256 + discount: "1+1",
257 + discountType: "buyOneGetOne",
258 + bannerImage: "playarea_banner",
259 + merchantLogo: "playarea_logo",
260 + expirationDate: "έως 30/09",
261 + color: "#9C27B0", // Purple
262 + isFavorite: false
263 + ),
264 +
265 + // Αγορές
266 + OfferModel(
267 + category: "Αγορές",
268 + title: "15€ έκπτωση",
269 + description: "για αγορές",
270 + discount: "15€",
271 + discountType: "amount",
272 + bannerImage: "fashion_banner",
273 + merchantLogo: "migato_logo",
274 + expirationDate: "έως 30/09",
275 + color: "#FF5722", // Deep Orange
276 + isFavorite: false
277 + ),
278 + OfferModel(
279 + category: "Αγορές",
280 + title: "Έως 30% έκπτωση",
281 + description: "στις αγορές σου",
282 + discount: "Έως 30%",
283 + discountType: "percentage",
284 + bannerImage: "shopping_banner",
285 + merchantLogo: "shopping_logo",
286 + expirationDate: "έως 30/09",
287 + color: "#FF5722", // Deep Orange
288 + isFavorite: false
289 + )
290 + ]
291 +
292 + var bannerOffersSection: SectionModel?
293 + var topOffersSection: SectionModel?
294 + var favoriteOffersSection: SectionModel?
295 + var sustainableOffersSection: SectionModel?
296 + var familyOffersSection: SectionModel?
297 + var foodOffersSection: SectionModel?
298 + var escapeOffersSection: SectionModel?
299 + var childOffersSection: SectionModel?
300 + var shoppingOffersSection: SectionModel?
301 +
12 public override func viewDidLoad() { 302 public override func viewDidLoad() {
13 super.viewDidLoad() 303 super.viewDidLoad()
304 +
305 + // Register XIBs for table view cells
306 + tableView.register(UINib(nibName: "MyRewardsBannerOffersScrollTableViewCell", bundle: Bundle(for: MyEmptyClass.self)), forCellReuseIdentifier: "BannerCell")
307 + tableView.register(UINib(nibName: "MyRewardsOffersScrollTableViewCell", bundle: Bundle(for: MyEmptyClass.self)), forCellReuseIdentifier: "OffersCell")
308 +
309 + // Set up table view
310 + tableView.delegate = self
311 + tableView.dataSource = self
312 + tableView.separatorStyle = .none
313 + tableView.estimatedRowHeight = 200
314 + tableView.rowHeight = UITableView.automaticDimension
315 +
316 + initializeSections()
317 + }
318 +
319 + // MARK: Function
320 + func initializeSections() {
321 + // Banner Offers (for the promotional banner at the top)
322 + let bannerOffers = allOffers.filter { $0.category == "Διαγωνισμός" }
323 + bannerOffersSection = SectionModel(
324 + title: "Διαγωνισμός",
325 + count: bannerOffers.count,
326 + offers: bannerOffers
327 + )
328 +
329 + // Top Offers
330 + let topOffers = allOffers.filter { $0.category == "Top offers" }
331 + topOffersSection = SectionModel(
332 + title: "Top offers",
333 + count: topOffers.count,
334 + offers: topOffers
335 + )
336 +
337 + // Favorite Offers
338 + let favoriteOffers = allOffers.filter { $0.isFavorite }
339 + favoriteOffersSection = SectionModel(
340 + title: "Αγαπημένα",
341 + count: favoriteOffers.count,
342 + offers: favoriteOffers
343 + )
344 +
345 + // Sustainable Offers
346 + let sustainableOffers = allOffers.filter { $0.category == "Βιωσιμότητα" }
347 + sustainableOffersSection = SectionModel(
348 + title: "Βιωσιμότητα",
349 + count: sustainableOffers.count,
350 + offers: sustainableOffers
351 + )
352 +
353 + // Family Offers
354 + let familyOffers = allOffers.filter { $0.category == "Family" }
355 + familyOffersSection = SectionModel(
356 + title: "Family",
357 + count: familyOffers.count,
358 + offers: familyOffers
359 + )
360 +
361 + // Food Offers
362 + let foodOffers = allOffers.filter { $0.category == "Φαγητό και καφές" }
363 + foodOffersSection = SectionModel(
364 + title: "Φαγητό και καφές",
365 + count: foodOffers.count,
366 + offers: foodOffers
367 + )
368 +
369 + // Escape Offers
370 + let escapeOffers = allOffers.filter { $0.category == "Απόδραση" }
371 + escapeOffersSection = SectionModel(
372 + title: "Απόδραση",
373 + count: escapeOffers.count,
374 + offers: escapeOffers
375 + )
14 376
15 - // Do any additional setup after loading the view. 377 + // Child Offers
378 + let childOffers = allOffers.filter { $0.category == "Παιδί" }
379 + childOffersSection = SectionModel(
380 + title: "Παιδί",
381 + count: childOffers.count,
382 + offers: childOffers
383 + )
384 +
385 + // Shopping Offers
386 + let shoppingOffers = allOffers.filter { $0.category == "Αγορές" }
387 + shoppingOffersSection = SectionModel(
388 + title: "Αγορές",
389 + count: shoppingOffers.count,
390 + offers: shoppingOffers
391 + )
392 +
393 + self.tableView.reloadData()
16 } 394 }
17 395
396 +}
18 397
19 - /* 398 +// MARK: - TableView
20 - // MARK: - Navigation 399 +extension MyRewardsViewController: UITableViewDelegate, UITableViewDataSource{
400 +
401 + public func numberOfSections(in tableView: UITableView) -> Int {
402 + return 9
403 + }
404 +
405 + public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
406 + return 1
407 + }
408 +
409 + public func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
410 + return UITableView.automaticDimension
411 + }
412 +
413 + public func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
414 + return nil
415 + }
21 416
22 - // In a storyboard-based application, you will often want to do a little preparation before navigation 417 + public func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
23 - override func prepare(for segue: UIStoryboardSegue, sender: Any?) { 418 + return 0.0
24 - // Get the new view controller using segue.destination.
25 - // Pass the selected object to the new view controller.
26 } 419 }
27 - */
28 420
421 + public func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
422 +// return CGFloat.leastNormalMagnitude
423 + return 0.0
424 + }
425 +
426 + public func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
427 + return nil
428 + }
429 +
430 + public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
431 + if (indexPath.section == 0) {
432 + let cell = tableView.dequeueReusableCell(withIdentifier: "MyRewardsBannerOffersScrollTableViewCell", for: indexPath) as! MyRewardsBannerOffersScrollTableViewCell
433 + let smCount = 1
434 + cell.configureCell(data: self.bannerOffersSection)
435 +// cell.parent = self
436 + return cell
437 +
438 + } else {
439 + let cell = tableView.dequeueReusableCell(withIdentifier: "MyRewardsOffersScrollTableViewCell", for: indexPath) as! MyRewardsOffersScrollTableViewCell
440 +
441 + if (indexPath.section == 1) {
442 + cell.configureCell(data: self.topOffersSection)
443 + } else if (indexPath.section == 2) {
444 + cell.configureCell(data: self.favoriteOffersSection)
445 + } else if (indexPath.section == 3) {
446 + cell.configureCell(data: self.sustainableOffersSection)
447 + } else if (indexPath.section == 4) {
448 + cell.configureCell(data: self.familyOffersSection)
449 + } else if (indexPath.section == 5) {
450 + cell.configureCell(data: self.foodOffersSection)
451 + } else if (indexPath.section == 6) {
452 + cell.configureCell(data: self.escapeOffersSection)
453 + } else if (indexPath.section == 7) {
454 + cell.configureCell(data: self.childOffersSection)
455 + } else {
456 + cell.configureCell(data: self.shoppingOffersSection)
457 + }
458 +
459 + return cell
460 + }
461 +
462 + }
463 +
464 + public func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
465 + if (indexPath.section == 0) {
466 + // Do nothing - Each button is handled differently
467 +
468 + } else if (indexPath.section == 1) {
469 + // Do nothing
470 + } else if (indexPath.section == 2) {
471 + // Do nothing
472 + } else if (indexPath.section == 3) {
473 + // Do nothing
474 + } else if (indexPath.section == 4) {
475 + // Do nothing
476 + } else if (indexPath.section == 5) {
477 + // Do nothing
478 + } else if (indexPath.section == 6) {
479 + // Do nothing
480 + } else if (indexPath.section == 7) {
481 + // Do nothing
482 + } else {
483 + // Do nothing
484 + }
485 + }
29 } 486 }
......
1 -<?xml version="1.0" encoding="UTF-8" standalone="no"?> 1 +<?xml version="1.0" encoding="UTF-8"?>
2 -<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13142" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> 2 +<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">
3 + <device id="retina6_12" orientation="portrait" appearance="light"/>
3 <dependencies> 4 <dependencies>
4 - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12042"/> 5 + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23084"/>
5 <capability name="Safe area layout guides" minToolsVersion="9.0"/> 6 <capability name="Safe area layout guides" minToolsVersion="9.0"/>
7 + <capability name="System colors in document resources" minToolsVersion="11.0"/>
6 <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> 8 <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
7 </dependencies> 9 </dependencies>
8 <objects> 10 <objects>
9 - <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="MyRewardsViewController" customModuleProvider="target"> 11 + <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="MyRewardsViewController" customModule="SwiftWarplyFramework" customModuleProvider="target">
10 <connections> 12 <connections>
13 + <outlet property="tableView" destination="2it-5M-CR6" id="uM3-ZJ-zKB"/>
11 <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/> 14 <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
12 </connections> 15 </connections>
13 </placeholder> 16 </placeholder>
14 <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> 17 <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
15 <view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT"> 18 <view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
16 - <rect key="frame" x="0.0" y="0.0" width="375" height="667"/> 19 + <rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
17 <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> 20 <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
18 - <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/> 21 + <subviews>
22 + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="scR-yg-okd" userLabel="Main View">
23 + <rect key="frame" x="0.0" y="59" width="393" height="793"/>
24 + <subviews>
25 + <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="grouped" separatorStyle="none" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="1" estimatedSectionFooterHeight="-1" contentViewInsetsToSafeArea="NO" translatesAutoresizingMaskIntoConstraints="NO" id="2it-5M-CR6">
26 + <rect key="frame" x="0.0" y="0.0" width="393" height="793"/>
27 + <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
28 + <color key="separatorColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
29 + <color key="sectionIndexBackgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
30 + <connections>
31 + <outlet property="dataSource" destination="-1" id="avy-hE-15l"/>
32 + <outlet property="delegate" destination="-1" id="tmq-4b-xNt"/>
33 + </connections>
34 + </tableView>
35 + </subviews>
36 + <color key="backgroundColor" red="0.94901960780000005" green="0.94901960780000005" blue="0.94901960780000005" alpha="1" colorSpace="calibratedRGB"/>
37 + <constraints>
38 + <constraint firstItem="2it-5M-CR6" firstAttribute="top" secondItem="scR-yg-okd" secondAttribute="top" id="8Qy-L0-5ab"/>
39 + <constraint firstAttribute="trailing" secondItem="2it-5M-CR6" secondAttribute="trailing" id="AXe-zP-ef8"/>
40 + <constraint firstItem="2it-5M-CR6" firstAttribute="leading" secondItem="scR-yg-okd" secondAttribute="leading" id="NeU-gh-skU"/>
41 + <constraint firstAttribute="bottom" secondItem="2it-5M-CR6" secondAttribute="bottom" id="bpx-U5-A8r"/>
42 + </constraints>
43 + </view>
44 + </subviews>
19 <viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/> 45 <viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
46 + <color key="backgroundColor" systemColor="systemBackgroundColor"/>
47 + <constraints>
48 + <constraint firstItem="scR-yg-okd" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="Nwv-jZ-0HT"/>
49 + <constraint firstItem="scR-yg-okd" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="OFK-BH-zlp"/>
50 + <constraint firstAttribute="trailing" secondItem="scR-yg-okd" secondAttribute="trailing" id="Wgk-0e-fYU"/>
51 + <constraint firstAttribute="bottom" secondItem="scR-yg-okd" secondAttribute="bottom" id="ogA-sg-Lij"/>
52 + </constraints>
53 + <point key="canvasLocation" x="11" y="-11"/>
20 </view> 54 </view>
21 </objects> 55 </objects>
56 + <resources>
57 + <systemColor name="systemBackgroundColor">
58 + <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
59 + </systemColor>
60 + </resources>
22 </document> 61 </document>
......