Manos Chorianopoulos

MyRewardsOffersScrollTableViewCellDelegate fixes

......@@ -17,6 +17,7 @@ protocol MyRewardsOffersScrollTableViewCellDelegate: AnyObject {
@IBOutlet weak var allButtonLabel: UILabel!
@IBOutlet weak var collectionView: UICollectionView!
@IBOutlet weak var collectionViewHeightConstraint: NSLayoutConstraint!
@IBOutlet weak var collectionViewBottom: NSLayoutConstraint!
weak var delegate: MyRewardsOffersScrollTableViewCellDelegate?
var data: SectionModel?
......@@ -75,8 +76,14 @@ protocol MyRewardsOffersScrollTableViewCellDelegate: AnyObject {
// Configure the view for the selected state
}
func configureCell(data: SectionModel?) {
func configureCell(data: SectionModel?, isInProfile: Bool? = false) {
self.data = data
if (isInProfile ?? false) {
collectionViewBottom.constant = 40
} else {
collectionViewBottom.constant = 0
}
// Update collection view height based on section
if data?.title == "Αγαπημένα" {
......
......@@ -306,7 +306,7 @@ extension ProfileViewController: UITableViewDelegate, UITableViewDataSource {
let cell = tableView.dequeueReusableCell(withIdentifier: "MyRewardsOffersScrollTableViewCell", for: indexPath) as! MyRewardsOffersScrollTableViewCell
cell.delegate = self // Set the offers delegate
cell.configureCell(data: self.forYouOffersSection)
cell.configureCell(data: self.forYouOffersSection, isInProfile: true)
return cell
......