Manos Chorianopoulos

reward offers fixes

...@@ -26,9 +26,11 @@ import UIKit ...@@ -26,9 +26,11 @@ import UIKit
26 allButtonLabel.text = "Όλα" 26 allButtonLabel.text = "Όλα"
27 allButtonLabel.font = UIFont(name: "PingLCG-Regular", size: 16) 27 allButtonLabel.font = UIFont(name: "PingLCG-Regular", size: 16)
28 allButtonLabel.textColor = UIColor(rgb: 0x00111B) 28 allButtonLabel.textColor = UIColor(rgb: 0x00111B)
29 + allButtonLabel.frame.size.width = allButtonLabel.intrinsicContentSize.width
30 + allButtonLabel.frame.size.height = allButtonLabel.intrinsicContentSize.height
29 31
30 // Register XIBs for collection view cells 32 // Register XIBs for collection view cells
31 - collectionView.register(UINib(nibName: "MyRewardsBannerOfferCollectionViewCell", bundle: Bundle(for: MyEmptyClass.self)), forCellWithReuseIdentifier: "MyRewardsBannerOfferCollectionViewCell") 33 + collectionView.register(UINib(nibName: "MyRewardsOfferCollectionViewCell", bundle: Bundle(for: MyEmptyClass.self)), forCellWithReuseIdentifier: "MyRewardsOfferCollectionViewCell")
32 34
33 // Fix background colors 35 // Fix background colors
34 collectionView.backgroundColor = UIColor.clear 36 collectionView.backgroundColor = UIColor.clear
...@@ -68,17 +70,10 @@ import UIKit ...@@ -68,17 +70,10 @@ import UIKit
68 } 70 }
69 71
70 func configureCell(data: SectionModel?) { 72 func configureCell(data: SectionModel?) {
71 -
72 -// struct SectionModel {
73 -// let title: String
74 -// let count: Int
75 -// let offers: [OfferModel]
76 -// }
77 -
78 self.data = data 73 self.data = data
79 74
80 let catBoldText = (data?.title ?? "") + " " 75 let catBoldText = (data?.title ?? "") + " "
81 - let catRegText = String(data?.count ?? 0) 76 + let catRegText = "(" + String(data?.count ?? 0) + ")"
82 77
83 let attrBold = [NSAttributedString.Key.font : UIFont(name: "PingLCG-Bold", size: 18) ?? UIFont.boldSystemFont(ofSize: 17), NSAttributedString.Key.foregroundColor: UIColor(rgb: 0x000F1E)] 78 let attrBold = [NSAttributedString.Key.font : UIFont(name: "PingLCG-Bold", size: 18) ?? UIFont.boldSystemFont(ofSize: 17), NSAttributedString.Key.foregroundColor: UIColor(rgb: 0x000F1E)]
84 let attrRegular = [NSAttributedString.Key.font : UIFont(name: "PingLCG-Regular", size: 18) ?? UIFont.systemFont(ofSize: 17), NSAttributedString.Key.foregroundColor: UIColor(rgb: 0x000F1E)] 79 let attrRegular = [NSAttributedString.Key.font : UIFont(name: "PingLCG-Regular", size: 18) ?? UIFont.systemFont(ofSize: 17), NSAttributedString.Key.foregroundColor: UIColor(rgb: 0x000F1E)]
...@@ -106,7 +101,7 @@ extension MyRewardsOffersScrollTableViewCell: UICollectionViewDataSource, UICol ...@@ -106,7 +101,7 @@ extension MyRewardsOffersScrollTableViewCell: UICollectionViewDataSource, UICol
106 } 101 }
107 102
108 public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { 103 public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
109 - let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "MyRewardsBannerOfferCollectionViewCell", for: indexPath) as! MyRewardsBannerOfferCollectionViewCell 104 + let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "MyRewardsOfferCollectionViewCell", for: indexPath) as! MyRewardsOfferCollectionViewCell
110 // cell.configureCell(offer: self.data?.offers[indexPath.row]) 105 // cell.configureCell(offer: self.data?.offers[indexPath.row])
111 if let offer = self.data?.offers[indexPath.row] { 106 if let offer = self.data?.offers[indexPath.row] {
112 cell.configureCell(data: offer) 107 cell.configureCell(data: offer)
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
31 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="9Qp-M4-KdO"> 31 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="9Qp-M4-KdO">
32 <rect key="frame" x="280" y="0.0" width="75" height="35"/> 32 <rect key="frame" x="280" y="0.0" width="75" height="35"/>
33 <subviews> 33 <subviews>
34 - <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"> 34 + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Όλα" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="KGA-M6-mox">
35 <rect key="frame" x="17" y="7" width="41" height="21"/> 35 <rect key="frame" x="17" y="7" width="41" height="21"/>
36 <fontDescription key="fontDescription" type="system" pointSize="17"/> 36 <fontDescription key="fontDescription" type="system" pointSize="17"/>
37 <nil key="textColor"/> 37 <nil key="textColor"/>
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
93 <constraint firstItem="E9Q-uB-Uvd" firstAttribute="top" secondItem="iQa-jk-pTS" secondAttribute="bottom" constant="5" id="BbT-IJ-sg4"/> 93 <constraint firstItem="E9Q-uB-Uvd" firstAttribute="top" secondItem="iQa-jk-pTS" secondAttribute="bottom" constant="5" id="BbT-IJ-sg4"/>
94 <constraint firstItem="iQa-jk-pTS" firstAttribute="leading" secondItem="3yR-f0-cq6" secondAttribute="leading" constant="24" id="C0X-4S-oP1"/> 94 <constraint firstItem="iQa-jk-pTS" firstAttribute="leading" secondItem="3yR-f0-cq6" secondAttribute="leading" constant="24" id="C0X-4S-oP1"/>
95 <constraint firstAttribute="trailing" secondItem="E9Q-uB-Uvd" secondAttribute="trailing" id="KNV-Sk-0rr"/> 95 <constraint firstAttribute="trailing" secondItem="E9Q-uB-Uvd" secondAttribute="trailing" id="KNV-Sk-0rr"/>
96 - <constraint firstItem="iQa-jk-pTS" firstAttribute="top" secondItem="3yR-f0-cq6" secondAttribute="top" constant="60" id="Saf-QC-O71"/> 96 + <constraint firstItem="iQa-jk-pTS" firstAttribute="top" secondItem="3yR-f0-cq6" secondAttribute="top" constant="50" id="Saf-QC-O71"/>
97 <constraint firstItem="E9Q-uB-Uvd" firstAttribute="leading" secondItem="3yR-f0-cq6" secondAttribute="leading" id="ToF-ce-EMM"/> 97 <constraint firstItem="E9Q-uB-Uvd" firstAttribute="leading" secondItem="3yR-f0-cq6" secondAttribute="leading" id="ToF-ce-EMM"/>
98 <constraint firstAttribute="bottom" secondItem="E9Q-uB-Uvd" secondAttribute="bottom" id="ssj-8N-2gP"/> 98 <constraint firstAttribute="bottom" secondItem="E9Q-uB-Uvd" secondAttribute="bottom" id="ssj-8N-2gP"/>
99 <constraint firstAttribute="trailing" secondItem="iQa-jk-pTS" secondAttribute="trailing" constant="24" id="zI6-rP-3kk"/> 99 <constraint firstAttribute="trailing" secondItem="iQa-jk-pTS" secondAttribute="trailing" constant="24" id="zI6-rP-3kk"/>
......