Manos Chorianopoulos

clean MyRewardsBannerOffersScrollTableViewCell

...@@ -9,17 +9,10 @@ import UIKit ...@@ -9,17 +9,10 @@ import UIKit
9 9
10 protocol MyRewardsBannerOffersScrollTableViewCellDelegate: AnyObject { 10 protocol MyRewardsBannerOffersScrollTableViewCellDelegate: AnyObject {
11 func didSelectBannerOffer(_ index: Int) 11 func didSelectBannerOffer(_ index: Int)
12 -// func didTapProfileButton()
13 } 12 }
14 13
15 @objc(MyRewardsBannerOffersScrollTableViewCell) 14 @objc(MyRewardsBannerOffersScrollTableViewCell)
16 public class MyRewardsBannerOffersScrollTableViewCell: UITableViewCell { 15 public class MyRewardsBannerOffersScrollTableViewCell: UITableViewCell {
17 - @IBOutlet weak var tagView1: UIView!
18 - @IBOutlet weak var tagLabel1: UILabel!
19 - @IBOutlet weak var tagView2: UIView!
20 - @IBOutlet weak var tagLabel2: UILabel!
21 - @IBOutlet weak var profileImage: UIImageView!
22 - @IBOutlet weak var profileButton: UIButton!
23 @IBOutlet weak var collectionView: UICollectionView! 16 @IBOutlet weak var collectionView: UICollectionView!
24 @IBOutlet weak var pageControl: UIPageControl! 17 @IBOutlet weak var pageControl: UIPageControl!
25 18
...@@ -30,21 +23,6 @@ public class MyRewardsBannerOffersScrollTableViewCell: UITableViewCell { ...@@ -30,21 +23,6 @@ public class MyRewardsBannerOffersScrollTableViewCell: UITableViewCell {
30 super.awakeFromNib() 23 super.awakeFromNib()
31 // Initialization code 24 // Initialization code
32 25
33 - profileImage.image = UIImage(named: "profile_pic_default", in: Bundle.frameworkResourceBundle, compatibleWith: nil)
34 -
35 - profileButton.addTarget(self, action: #selector(profileButtonTapped), for: .touchUpInside)
36 -
37 - tagView1.backgroundColor = UIColor(rgb: 0x09914E)
38 - tagView1.layer.cornerRadius = 4.0
39 - tagLabel1.font = UIFont(name: "PingLCG-Regular", size: 17)
40 - tagLabel1.textColor = UIColor(rgb: 0xFFFFFF)
41 -
42 - tagView2.backgroundColor = UIColor(rgb: 0xFC9F25)
43 - tagView2.layer.cornerRadius = 4.0
44 - tagLabel2.font = UIFont(name: "PingLCG-Regular", size: 17)
45 - tagLabel2.textColor = UIColor(rgb: 0xFFFFFF)
46 -
47 -
48 // Register XIBs for collection view cells 26 // Register XIBs for collection view cells
49 collectionView.register(UINib(nibName: "MyRewardsBannerOfferCollectionViewCell", bundle: Bundle.frameworkBundle), forCellWithReuseIdentifier: "MyRewardsBannerOfferCollectionViewCell") 27 collectionView.register(UINib(nibName: "MyRewardsBannerOfferCollectionViewCell", bundle: Bundle.frameworkBundle), forCellWithReuseIdentifier: "MyRewardsBannerOfferCollectionViewCell")
50 28
...@@ -101,10 +79,6 @@ public class MyRewardsBannerOffersScrollTableViewCell: UITableViewCell { ...@@ -101,10 +79,6 @@ public class MyRewardsBannerOffersScrollTableViewCell: UITableViewCell {
101 self.collectionView.reloadData(); 79 self.collectionView.reloadData();
102 } 80 }
103 81
104 - @objc private func profileButtonTapped() {
105 - // TODO: UNCOMMENT
106 -// delegate?.didTapProfileButton()
107 - }
108 } 82 }
109 83
110 extension MyRewardsBannerOffersScrollTableViewCell: UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout, UIScrollViewDelegate { 84 extension MyRewardsBannerOffersScrollTableViewCell: UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout, UIScrollViewDelegate {
......
...@@ -12,101 +12,15 @@ ...@@ -12,101 +12,15 @@
12 <tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="MyRewardsBannerOffersScrollTableViewCell" rowHeight="349" id="KGk-i7-Jjw" customClass="MyRewardsBannerOffersScrollTableViewCell"> 12 <tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="MyRewardsBannerOffersScrollTableViewCell" rowHeight="349" id="KGk-i7-Jjw" customClass="MyRewardsBannerOffersScrollTableViewCell">
13 <rect key="frame" x="0.0" y="0.0" width="413" height="349"/> 13 <rect key="frame" x="0.0" y="0.0" width="413" height="349"/>
14 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> 14 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
15 - <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM"> 15 + <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" ambiguous="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
16 <rect key="frame" x="0.0" y="0.0" width="413" height="349"/> 16 <rect key="frame" x="0.0" y="0.0" width="413" height="349"/>
17 <autoresizingMask key="autoresizingMask"/> 17 <autoresizingMask key="autoresizingMask"/>
18 <subviews> 18 <subviews>
19 - <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="VzF-dQ-3Wa" userLabel="Parent View"> 19 + <view contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="VzF-dQ-3Wa" userLabel="Parent View">
20 <rect key="frame" x="0.0" y="0.0" width="413" height="349"/> 20 <rect key="frame" x="0.0" y="0.0" width="413" height="349"/>
21 <subviews> 21 <subviews>
22 - <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="JTs-J5-DO2" userLabel="Top View">
23 - <rect key="frame" x="24" y="36" width="365" height="35"/>
24 - <subviews>
25 - <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="h09-MS-XKy">
26 - <rect key="frame" x="0.0" y="4.6666666666666643" width="58" height="26"/>
27 - <subviews>
28 - <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">
29 - <rect key="frame" x="6" y="3" width="46" height="20"/>
30 - <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
31 - <fontDescription key="fontDescription" name="HelveticaNeue" family="Helvetica Neue" pointSize="17"/>
32 - <nil key="textColor"/>
33 - <nil key="highlightedColor"/>
34 - </label>
35 - </subviews>
36 - <color key="backgroundColor" red="0.035294117647058823" green="0.56862745098039214" blue="0.30588235294117649" alpha="1" colorSpace="calibratedRGB"/>
37 - <constraints>
38 - <constraint firstAttribute="bottom" secondItem="4m7-JY-MDY" secondAttribute="bottom" constant="3" id="lbW-sK-uoN"/>
39 - <constraint firstItem="4m7-JY-MDY" firstAttribute="leading" secondItem="h09-MS-XKy" secondAttribute="leading" constant="6" id="oRk-5c-ko2"/>
40 - <constraint firstAttribute="trailing" secondItem="4m7-JY-MDY" secondAttribute="trailing" constant="6" id="rOt-tf-dSS"/>
41 - <constraint firstItem="4m7-JY-MDY" firstAttribute="top" secondItem="h09-MS-XKy" secondAttribute="top" constant="3" id="tui-5x-ntO"/>
42 - </constraints>
43 - </view>
44 - <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="H5g-xq-68p">
45 - <rect key="frame" x="66" y="4.6666666666666643" width="61.666666666666657" height="26"/>
46 - <subviews>
47 - <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">
48 - <rect key="frame" x="6" y="3" width="49.666666666666664" height="20"/>
49 - <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
50 - <fontDescription key="fontDescription" name="HelveticaNeue" family="Helvetica Neue" pointSize="17"/>
51 - <nil key="textColor"/>
52 - <nil key="highlightedColor"/>
53 - </label>
54 - </subviews>
55 - <color key="backgroundColor" red="0.9882352941176471" green="0.62352941176470589" blue="0.14509803921568626" alpha="1" colorSpace="calibratedRGB"/>
56 - <constraints>
57 - <constraint firstAttribute="bottom" secondItem="WN9-wM-hV8" secondAttribute="bottom" constant="3" id="12P-zS-ZRM"/>
58 - <constraint firstItem="WN9-wM-hV8" firstAttribute="leading" secondItem="H5g-xq-68p" secondAttribute="leading" constant="6" id="O5x-bk-yjz"/>
59 - <constraint firstAttribute="trailing" secondItem="WN9-wM-hV8" secondAttribute="trailing" constant="6" id="lnW-mb-d4H"/>
60 - <constraint firstItem="WN9-wM-hV8" firstAttribute="top" secondItem="H5g-xq-68p" secondAttribute="top" constant="3" id="pwW-Ed-yv2"/>
61 - </constraints>
62 - </view>
63 - <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="5cf-tr-Vjf">
64 - <rect key="frame" x="322" y="0.0" width="43" height="35"/>
65 - <subviews>
66 - <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="fZO-NB-UyL">
67 - <rect key="frame" x="0.0" y="0.0" width="43" height="43"/>
68 - <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
69 - <constraints>
70 - <constraint firstAttribute="width" constant="43" id="Obc-SE-A5u"/>
71 - <constraint firstAttribute="height" constant="43" id="lZJ-VG-4fl"/>
72 - </constraints>
73 - </imageView>
74 - <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="loI-CB-MX1" userLabel="ProfileButton">
75 - <rect key="frame" x="0.0" y="0.0" width="43" height="35"/>
76 - <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
77 - <state key="normal" title="Button"/>
78 - <buttonConfiguration key="configuration" style="plain" title="Button">
79 - <color key="baseForegroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
80 - </buttonConfiguration>
81 - </button>
82 - </subviews>
83 - <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
84 - <constraints>
85 - <constraint firstAttribute="trailing" secondItem="loI-CB-MX1" secondAttribute="trailing" id="0PQ-cq-sCt"/>
86 - <constraint firstItem="fZO-NB-UyL" firstAttribute="leading" secondItem="5cf-tr-Vjf" secondAttribute="leading" id="Bfw-5S-wqz"/>
87 - <constraint firstItem="fZO-NB-UyL" firstAttribute="top" secondItem="5cf-tr-Vjf" secondAttribute="top" id="WCt-TJ-XQc"/>
88 - <constraint firstItem="loI-CB-MX1" firstAttribute="top" secondItem="5cf-tr-Vjf" secondAttribute="top" id="XKb-DI-owX"/>
89 - <constraint firstAttribute="trailing" secondItem="fZO-NB-UyL" secondAttribute="trailing" id="Z0D-wE-fgE"/>
90 - <constraint firstItem="loI-CB-MX1" firstAttribute="leading" secondItem="5cf-tr-Vjf" secondAttribute="leading" id="fM6-dS-psa"/>
91 - <constraint firstAttribute="bottom" secondItem="fZO-NB-UyL" secondAttribute="bottom" id="nuy-88-N5B"/>
92 - <constraint firstAttribute="bottom" secondItem="loI-CB-MX1" secondAttribute="bottom" id="rMQ-Ec-OZs"/>
93 - </constraints>
94 - </view>
95 - </subviews>
96 - <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
97 - <constraints>
98 - <constraint firstItem="5cf-tr-Vjf" firstAttribute="top" secondItem="JTs-J5-DO2" secondAttribute="top" id="GGh-C1-OfA"/>
99 - <constraint firstItem="h09-MS-XKy" firstAttribute="leading" secondItem="JTs-J5-DO2" secondAttribute="leading" id="HNw-gn-pHJ"/>
100 - <constraint firstItem="H5g-xq-68p" firstAttribute="centerY" secondItem="JTs-J5-DO2" secondAttribute="centerY" id="Lwo-5b-tgm"/>
101 - <constraint firstAttribute="trailing" secondItem="5cf-tr-Vjf" secondAttribute="trailing" id="PBw-4p-3qC"/>
102 - <constraint firstItem="5cf-tr-Vjf" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="H5g-xq-68p" secondAttribute="trailing" constant="8" id="Wot-lB-jmI"/>
103 - <constraint firstAttribute="bottom" secondItem="5cf-tr-Vjf" secondAttribute="bottom" id="geG-Wp-p9Z"/>
104 - <constraint firstItem="h09-MS-XKy" firstAttribute="centerY" secondItem="JTs-J5-DO2" secondAttribute="centerY" id="j5f-Os-TZ0"/>
105 - <constraint firstItem="H5g-xq-68p" firstAttribute="leading" secondItem="h09-MS-XKy" secondAttribute="trailing" constant="8" id="wqx-Hc-3YH"/>
106 - </constraints>
107 - </view>
108 <collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" dataMode="none" translatesAutoresizingMaskIntoConstraints="NO" id="I7z-Fz-SNP"> 22 <collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" dataMode="none" translatesAutoresizingMaskIntoConstraints="NO" id="I7z-Fz-SNP">
109 - <rect key="frame" x="0.0" y="-25" width="413" height="348"/> 23 + <rect key="frame" x="0.0" y="20" width="413" height="348"/>
110 <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> 24 <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
111 <constraints> 25 <constraints>
112 <constraint firstAttribute="height" constant="348" id="aEf-Xl-A2C"/> 26 <constraint firstAttribute="height" constant="348" id="aEf-Xl-A2C"/>
...@@ -124,26 +38,18 @@ ...@@ -124,26 +38,18 @@
124 </connections> 38 </connections>
125 </collectionView> 39 </collectionView>
126 <pageControl opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" numberOfPages="3" translatesAutoresizingMaskIntoConstraints="NO" id="lOm-CZ-dVG"> 40 <pageControl opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" numberOfPages="3" translatesAutoresizingMaskIntoConstraints="NO" id="lOm-CZ-dVG">
127 - <rect key="frame" x="170" y="323" width="73" height="26"/> 41 + <rect key="frame" x="170" y="368" width="73" height="26"/>
128 </pageControl> 42 </pageControl>
129 </subviews> 43 </subviews>
130 <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> 44 <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
131 <constraints> 45 <constraints>
132 <constraint firstItem="lOm-CZ-dVG" firstAttribute="top" secondItem="I7z-Fz-SNP" secondAttribute="bottom" id="0xG-dd-XJl"/> 46 <constraint firstItem="lOm-CZ-dVG" firstAttribute="top" secondItem="I7z-Fz-SNP" secondAttribute="bottom" id="0xG-dd-XJl"/>
133 <constraint firstAttribute="bottom" secondItem="lOm-CZ-dVG" secondAttribute="bottom" id="7gm-Kg-nCS"/> 47 <constraint firstAttribute="bottom" secondItem="lOm-CZ-dVG" secondAttribute="bottom" id="7gm-Kg-nCS"/>
134 - <constraint firstItem="JTs-J5-DO2" firstAttribute="top" secondItem="VzF-dQ-3Wa" secondAttribute="top" constant="36" id="Ac5-fx-J3w"/>
135 - <constraint firstItem="JTs-J5-DO2" firstAttribute="leading" secondItem="VzF-dQ-3Wa" secondAttribute="leading" constant="24" id="B98-id-FLf"/>
136 - <constraint firstAttribute="trailing" secondItem="JTs-J5-DO2" secondAttribute="trailing" constant="24" id="Rdi-FK-2Ft"/>
137 <constraint firstAttribute="trailing" secondItem="I7z-Fz-SNP" secondAttribute="trailing" id="avB-Gc-ttI"/> 48 <constraint firstAttribute="trailing" secondItem="I7z-Fz-SNP" secondAttribute="trailing" id="avB-Gc-ttI"/>
138 <constraint firstItem="I7z-Fz-SNP" firstAttribute="leading" secondItem="VzF-dQ-3Wa" secondAttribute="leading" id="pTY-7d-s1S"/> 49 <constraint firstItem="I7z-Fz-SNP" firstAttribute="leading" secondItem="VzF-dQ-3Wa" secondAttribute="leading" id="pTY-7d-s1S"/>
139 <constraint firstItem="I7z-Fz-SNP" firstAttribute="top" secondItem="VzF-dQ-3Wa" secondAttribute="top" constant="20" id="vJF-jy-p83"/> 50 <constraint firstItem="I7z-Fz-SNP" firstAttribute="top" secondItem="VzF-dQ-3Wa" secondAttribute="top" constant="20" id="vJF-jy-p83"/>
140 <constraint firstItem="lOm-CZ-dVG" firstAttribute="centerX" secondItem="VzF-dQ-3Wa" secondAttribute="centerX" id="xpw-tV-NcW"/> 51 <constraint firstItem="lOm-CZ-dVG" firstAttribute="centerX" secondItem="VzF-dQ-3Wa" secondAttribute="centerX" id="xpw-tV-NcW"/>
141 </constraints> 52 </constraints>
142 - <variation key="default">
143 - <mask key="subviews">
144 - <exclude reference="JTs-J5-DO2"/>
145 - </mask>
146 - </variation>
147 </view> 53 </view>
148 </subviews> 54 </subviews>
149 <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> 55 <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
...@@ -159,12 +65,6 @@ ...@@ -159,12 +65,6 @@
159 <connections> 65 <connections>
160 <outlet property="collectionView" destination="I7z-Fz-SNP" id="yrF-mR-aQu"/> 66 <outlet property="collectionView" destination="I7z-Fz-SNP" id="yrF-mR-aQu"/>
161 <outlet property="pageControl" destination="lOm-CZ-dVG" id="Skf-hV-rjH"/> 67 <outlet property="pageControl" destination="lOm-CZ-dVG" id="Skf-hV-rjH"/>
162 - <outlet property="profileButton" destination="loI-CB-MX1" id="VTG-C3-3KA"/>
163 - <outlet property="profileImage" destination="fZO-NB-UyL" id="l05-qG-DJv"/>
164 - <outlet property="tagLabel1" destination="4m7-JY-MDY" id="Min-YW-AN2"/>
165 - <outlet property="tagLabel2" destination="WN9-wM-hV8" id="yWk-1S-4Zk"/>
166 - <outlet property="tagView1" destination="h09-MS-XKy" id="Hxa-cN-6i4"/>
167 - <outlet property="tagView2" destination="H5g-xq-68p" id="Vcv-Si-g68"/>
168 </connections> 68 </connections>
169 <point key="canvasLocation" x="72.51908396946564" y="95.422535211267615"/> 69 <point key="canvasLocation" x="72.51908396946564" y="95.422535211267615"/>
170 </tableViewCell> 70 </tableViewCell>
......