Manos Chorianopoulos

reward offers fixes

......@@ -26,9 +26,11 @@ import UIKit
allButtonLabel.text = "Όλα"
allButtonLabel.font = UIFont(name: "PingLCG-Regular", size: 16)
allButtonLabel.textColor = UIColor(rgb: 0x00111B)
allButtonLabel.frame.size.width = allButtonLabel.intrinsicContentSize.width
allButtonLabel.frame.size.height = allButtonLabel.intrinsicContentSize.height
// Register XIBs for collection view cells
collectionView.register(UINib(nibName: "MyRewardsBannerOfferCollectionViewCell", bundle: Bundle(for: MyEmptyClass.self)), forCellWithReuseIdentifier: "MyRewardsBannerOfferCollectionViewCell")
collectionView.register(UINib(nibName: "MyRewardsOfferCollectionViewCell", bundle: Bundle(for: MyEmptyClass.self)), forCellWithReuseIdentifier: "MyRewardsOfferCollectionViewCell")
// Fix background colors
collectionView.backgroundColor = UIColor.clear
......@@ -68,17 +70,10 @@ 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 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)]
......@@ -106,7 +101,7 @@ extension MyRewardsOffersScrollTableViewCell: UICollectionViewDataSource, UICol
}
public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "MyRewardsBannerOfferCollectionViewCell", for: indexPath) as! MyRewardsBannerOfferCollectionViewCell
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "MyRewardsOfferCollectionViewCell", for: indexPath) as! MyRewardsOfferCollectionViewCell
// cell.configureCell(offer: self.data?.offers[indexPath.row])
if let offer = self.data?.offers[indexPath.row] {
cell.configureCell(data: offer)
......
......@@ -31,7 +31,7 @@
<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">
<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">
<rect key="frame" x="17" y="7" width="41" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
......@@ -93,7 +93,7 @@
<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="iQa-jk-pTS" firstAttribute="top" secondItem="3yR-f0-cq6" secondAttribute="top" constant="50" 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"/>
......