Manos Chorianopoulos

add MyRewardsProfileInfoTableViewCell

......@@ -48,6 +48,8 @@ let package = Package(
.process("screens/MyRewardsViewController/MyRewardsViewController.xib"),
.process("cells/MyRewardsBannerOfferCollectionViewCell/MyRewardsBannerOfferCollectionViewCell.xib"),
.process("cells/MyRewardsOffersScrollTableViewCell/MyRewardsOffersScrollTableViewCell.xib"),
.process("cells/MyRewardsProfileInfoTableViewCell/MyRewardsProfileInfoTableViewCell.xib"),
.process("cells/MyRewardsFiltersTableViewCell/MyRewardsFiltersTableViewCell.xib"),
.process("cells/ProfileCouponTableViewCell/ProfileCouponTableViewCell.xib"),
.process("cells/ProfileFilterCollectionViewCell/ProfileFilterCollectionViewCell.xib"),
.process("screens/CouponViewController/CouponViewController.xib"),
......
......@@ -7,7 +7,7 @@
<key>Pods-SwiftWarplyFramework.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
<integer>0</integer>
</dict>
</dict>
</dict>
......
......@@ -73,6 +73,8 @@
1EDD0AC62E0D68B6005E162B /* SQLite in Frameworks */ = {isa = PBXBuildFile; productRef = 1EDD0AC52E0D68B6005E162B /* SQLite */; };
622DA0AE2F51CAEE00308AB8 /* CouponsetViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 622DA0AD2F51CAEE00308AB8 /* CouponsetViewController.xib */; };
622DA0AF2F51CAEE00308AB8 /* CouponsetViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 622DA0AC2F51CAEE00308AB8 /* CouponsetViewController.swift */; };
6250ABCA2F6D5ABE002A5A8D /* MyRewardsFiltersTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6250ABC92F6D5ABE002A5A8D /* MyRewardsFiltersTableViewCell.xib */; };
6250ABCB2F6D5ABE002A5A8D /* MyRewardsFiltersTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6250ABC82F6D5ABE002A5A8D /* MyRewardsFiltersTableViewCell.swift */; };
626AF6DB2F698FF1008BCA08 /* MerchantAnnotation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 626AF6DA2F698FF1008BCA08 /* MerchantAnnotation.swift */; };
626AF6DE2F699081008BCA08 /* MapViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 626AF6DC2F699081008BCA08 /* MapViewController.swift */; };
626AF6DF2F699081008BCA08 /* MapViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 626AF6DD2F699081008BCA08 /* MapViewController.xib */; };
......@@ -166,6 +168,8 @@
1EDD0ABC2E0D308A005E162B /* XIBLoader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XIBLoader.swift; sourceTree = "<group>"; };
622DA0AC2F51CAEE00308AB8 /* CouponsetViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CouponsetViewController.swift; sourceTree = "<group>"; };
622DA0AD2F51CAEE00308AB8 /* CouponsetViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CouponsetViewController.xib; sourceTree = "<group>"; };
6250ABC82F6D5ABE002A5A8D /* MyRewardsFiltersTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyRewardsFiltersTableViewCell.swift; sourceTree = "<group>"; };
6250ABC92F6D5ABE002A5A8D /* MyRewardsFiltersTableViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MyRewardsFiltersTableViewCell.xib; sourceTree = "<group>"; };
626AF6DA2F698FF1008BCA08 /* MerchantAnnotation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MerchantAnnotation.swift; sourceTree = "<group>"; };
626AF6DC2F699081008BCA08 /* MapViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapViewController.swift; sourceTree = "<group>"; };
626AF6DD2F699081008BCA08 /* MapViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MapViewController.xib; sourceTree = "<group>"; };
......@@ -385,6 +389,7 @@
1EB4F4282DE0A09500D934C0 /* MyRewardsOffersScrollTableViewCell */,
1EB4F4222DE09A4300D934C0 /* MyRewardsBannerOffersScrollTableViewCell */,
1E66E4942E30F8C600BCEF9D /* MyRewardsProfileInfoTableViewCell */,
6250ABC72F6D5A87002A5A8D /* MyRewardsFiltersTableViewCell */,
);
path = cells;
sourceTree = "<group>";
......@@ -479,6 +484,15 @@
path = CouponsetViewController;
sourceTree = "<group>";
};
6250ABC72F6D5A87002A5A8D /* MyRewardsFiltersTableViewCell */ = {
isa = PBXGroup;
children = (
6250ABC82F6D5ABE002A5A8D /* MyRewardsFiltersTableViewCell.swift */,
6250ABC92F6D5ABE002A5A8D /* MyRewardsFiltersTableViewCell.xib */,
);
path = MyRewardsFiltersTableViewCell;
sourceTree = "<group>";
};
626AF6D92F698F96008BCA08 /* MapViewController */ = {
isa = PBXGroup;
children = (
......@@ -713,6 +727,7 @@
1EDBAF042DE843CA00911E79 /* ProfileCouponTableViewCell.xib in Resources */,
627B9C762F6C3EB000A2456F /* CategoryOffersViewController.xib in Resources */,
1EDBAF0C2DE8441000911E79 /* ProfileQuestionnaireTableViewCell.xib in Resources */,
6250ABCA2F6D5ABE002A5A8D /* MyRewardsFiltersTableViewCell.xib in Resources */,
E6A77A38282BC3530045BBA8 /* Media.xcassets in Resources */,
627B9C852F6C492F00A2456F /* CategoryOffersGridTableViewCell.xib in Resources */,
1E116F682DE845B1009AE791 /* ProfileFilterCollectionViewCell.xib in Resources */,
......@@ -819,6 +834,7 @@
1E917CD72DDF64B2002221D8 /* MyRewardsViewController.swift in Sources */,
1E917CDC2DDF68C7002221D8 /* CouponViewController.swift in Sources */,
1E4C4CFB2DE6014500279AAD /* CopyableLabel.swift in Sources */,
6250ABCB2F6D5ABE002A5A8D /* MyRewardsFiltersTableViewCell.swift in Sources */,
626AF6DE2F699081008BCA08 /* MapViewController.swift in Sources */,
1EDBAF112DE8443B00911E79 /* ProfileHeaderTableViewCell.swift in Sources */,
1EDBAF052DE843CA00911E79 /* ProfileCouponTableViewCell.swift in Sources */,
......
......@@ -7,7 +7,7 @@
<key>SwiftWarplyFramework.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
<integer>1</integer>
</dict>
</dict>
</dict>
......
//
// MyRewardsFiltersTableViewCell.swift
// SwiftWarplyFramework
//
// Created by Manos Chorianopoulos on 20/3/26.
//
import UIKit
@objc(MyRewardsFiltersTableViewCell)
public class MyRewardsFiltersTableViewCell: UITableViewCell {
@IBOutlet weak var filtersView: UIView!
@IBOutlet weak var filtersLabel: UILabel!
@IBOutlet weak var filtersImage: UIImageView!
@IBOutlet weak var mapView: UIView!
@IBOutlet weak var mapImage: UIImageView!
@IBOutlet weak var filtersButton: UIButton!
@IBOutlet weak var mapButton: UIButton!
public override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
self.filtersView.backgroundColor = UIColor(rgb: 0xF1F2F4)
self.filtersView.layer.cornerRadius = 16 // Assuming height is 32 or similar based on standard chip design
self.filtersView.layer.masksToBounds = true
self.filtersLabel.text = "Αναζήτηση"
self.filtersLabel.font = UIFont(name: "PingLCG-Regular", size: 16)
self.filtersLabel.textColor = UIColor(rgb: 0x000F1E)
self.filtersLabel.frame.size.width = self.filtersLabel.intrinsicContentSize.width
self.filtersLabel.frame.size.height = self.filtersLabel.intrinsicContentSize.height
self.filtersImage.image = UIImage(named: "filter", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
if mapView != nil {
self.mapView.backgroundColor = UIColor(rgb: 0xF1F2F4)
self.mapView.layer.cornerRadius = 22 // Assuming height is 44
self.mapView.layer.masksToBounds = true
}
if mapImage != nil {
self.mapImage.image = UIImage(named: "map_pin_2", in: Bundle.frameworkResourceBundle, compatibleWith: nil)
}
}
public override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
}
......@@ -12,6 +12,7 @@ import Foundation
public enum SectionType {
case myRewardsProfileInfo // MyRewardsProfileInfoTableViewCell
case myRewardsFilters // MyRewardsFiltersTableViewCell
case myRewardsBannerOffers // MyRewardsBannerOffersScrollTableViewCell
case myRewardsHorizontalCouponsets // MyRewardsOffersScrollTableViewCell
case profileHeader // ProfileHeaderTableViewCell (no items)
......
......@@ -135,6 +135,7 @@ import UIKit
private func registerTableViewCells() {
let cellConfigs = [
("MyRewardsProfileInfoTableViewCell", "MyRewardsProfileInfoTableViewCell"),
("MyRewardsFiltersTableViewCell", "MyRewardsFiltersTableViewCell"),
("MyRewardsBannerOffersScrollTableViewCell", "MyRewardsBannerOffersScrollTableViewCell"),
("MyRewardsOffersScrollTableViewCell", "MyRewardsOffersScrollTableViewCell")
]
......@@ -573,6 +574,10 @@ import UIKit
// Always insert at index 0 (top of the list)
sections.insert(defaultProfileSection, at: 0)
profileSection = defaultProfileSection
// Insert filters cell immediately below profile info
let filtersSection = SectionModel(sectionType: .myRewardsFilters)
sections.insert(filtersSection, at: 1)
}
private func updateProfileSectionWithData(_ profile: ProfileModel) {
......@@ -734,6 +739,12 @@ extension MyRewardsViewController: UITableViewDelegate, UITableViewDataSource{
cell.configureCell(data: sectionModel)
return cell
case .myRewardsFilters:
let cell = tableView.dequeueReusableCell(withIdentifier: "MyRewardsFiltersTableViewCell", for: indexPath) as! MyRewardsFiltersTableViewCell
// TODO: wire filtersButton action (e.g. open filter sheet)
// TODO: wire mapButton action (e.g. open map view)
return cell
case .myRewardsBannerOffers:
let cell = tableView.dequeueReusableCell(withIdentifier: "MyRewardsBannerOffersScrollTableViewCell", for: indexPath) as! MyRewardsBannerOffersScrollTableViewCell
cell.delegate = self
......