Manos Chorianopoulos

MyCouponsViewController

...@@ -50,7 +50,7 @@ import UIKit ...@@ -50,7 +50,7 @@ import UIKit
50 // Show navigation bar for this screen (with back button) 50 // Show navigation bar for this screen (with back button)
51 self.navigationController?.setNavigationBarHidden(false, animated: false) 51 self.navigationController?.setNavigationBarHidden(false, animated: false)
52 setBackButton() 52 setBackButton()
53 - setNavigationTitle("Το προφίλ μου") 53 + // setNavigationTitle("Το προφίλ μου")
54 54
55 // UPDATED: Safe XIB registration with error handling 55 // UPDATED: Safe XIB registration with error handling
56 registerTableViewCells() 56 registerTableViewCells()
...@@ -73,8 +73,6 @@ import UIKit ...@@ -73,8 +73,6 @@ import UIKit
73 private func registerTableViewCells() { 73 private func registerTableViewCells() {
74 let cellConfigs = [ 74 let cellConfigs = [
75 ("MyCouponsHeaderTableViewCell", "MyCouponsHeaderTableViewCell"), 75 ("MyCouponsHeaderTableViewCell", "MyCouponsHeaderTableViewCell"),
76 - ("ProfileQuestionnaireTableViewCell", "ProfileQuestionnaireTableViewCell"),
77 - ("MyRewardsOffersScrollTableViewCell", "MyRewardsOffersScrollTableViewCell"),
78 ("ProfileCouponFiltersTableViewCell", "ProfileCouponFiltersTableViewCell"), 76 ("ProfileCouponFiltersTableViewCell", "ProfileCouponFiltersTableViewCell"),
79 ("ProfileCouponTableViewCell", "ProfileCouponTableViewCell") 77 ("ProfileCouponTableViewCell", "ProfileCouponTableViewCell")
80 ] 78 ]
...@@ -273,7 +271,7 @@ extension MyCouponsViewController: UITableViewDelegate, UITableViewDataSource { ...@@ -273,7 +271,7 @@ extension MyCouponsViewController: UITableViewDelegate, UITableViewDataSource {
273 271
274 public func numberOfSections(in tableView: UITableView) -> Int { 272 public func numberOfSections(in tableView: UITableView) -> Int {
275 // return 4 + (filteredOffersSection?.offers.count ?? 0) 273 // return 4 + (filteredOffersSection?.offers.count ?? 0)
276 - return 5 274 + return 3
277 } 275 }
278 276
279 public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 277 public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
...@@ -320,18 +318,6 @@ extension MyCouponsViewController: UITableViewDelegate, UITableViewDataSource { ...@@ -320,18 +318,6 @@ extension MyCouponsViewController: UITableViewDelegate, UITableViewDataSource {
320 return cell 318 return cell
321 319
322 } else if (indexPath.section == 1) { 320 } else if (indexPath.section == 1) {
323 - let cell = tableView.dequeueReusableCell(withIdentifier: "ProfileQuestionnaireTableViewCell", for: indexPath) as! ProfileQuestionnaireTableViewCell
324 - return cell
325 -
326 - } else if (indexPath.section == 2) {
327 - let cell = tableView.dequeueReusableCell(withIdentifier: "MyRewardsOffersScrollTableViewCell", for: indexPath) as! MyRewardsOffersScrollTableViewCell
328 -
329 - cell.delegate = self // Set the offers delegate
330 - cell.configureCell(data: self.forYouOffersSection, isInProfile: true)
331 -
332 - return cell
333 -
334 - } else if (indexPath.section == 3) {
335 let cell = tableView.dequeueReusableCell(withIdentifier: "ProfileCouponFiltersTableViewCell", for: indexPath) as! ProfileCouponFiltersTableViewCell 321 let cell = tableView.dequeueReusableCell(withIdentifier: "ProfileCouponFiltersTableViewCell", for: indexPath) as! ProfileCouponFiltersTableViewCell
336 322
337 cell.delegate = self // Set the offers delegate 323 cell.delegate = self // Set the offers delegate
...@@ -371,19 +357,6 @@ extension MyCouponsViewController: UITableViewDelegate, UITableViewDataSource { ...@@ -371,19 +357,6 @@ extension MyCouponsViewController: UITableViewDelegate, UITableViewDataSource {
371 } 357 }
372 358
373 // Add delegate conformance 359 // Add delegate conformance
374 -extension MyCouponsViewController: MyRewardsOffersScrollTableViewCellDelegate {
375 - func didSelectOffer(_ offer: OfferModel) {
376 - // Legacy OfferModel handling — no longer used but kept for protocol conformance
377 - print("⚠️ [MyCouponsVC] didSelectOffer called with legacy OfferModel — should not happen")
378 - }
379 -
380 - func didSelectCouponSet(_ couponSet: CouponSetItemModel) {
381 - // MyCouponsViewController doesn't handle coupon sets, so just log
382 - print("CouponSet selected in MyCouponsViewController: \(couponSet._name)")
383 - }
384 -}
385 -
386 -// Add delegate conformance
387 extension MyCouponsViewController: ProfileCouponFiltersTableViewCellDelegate { 360 extension MyCouponsViewController: ProfileCouponFiltersTableViewCellDelegate {
388 func didSelectFilter(_ filter: CouponFilterModel) { 361 func didSelectFilter(_ filter: CouponFilterModel) {
389 self.couponFilterSelected = filter 362 self.couponFilterSelected = filter
......
...@@ -122,7 +122,9 @@ import UIKit ...@@ -122,7 +122,9 @@ import UIKit
122 } 122 }
123 123
124 @objc private func myCouponsButtonTapped() { 124 @objc private func myCouponsButtonTapped() {
125 - // TODO: open CouponsVC 125 + let vc = SwiftWarplyFramework.MyCouponsViewController(nibName: "MyCouponsViewController", bundle: Bundle.frameworkBundle)
126 +
127 + self.navigationController?.pushViewController(vc, animated: true)
126 } 128 }
127 129
128 // NEW: Safe XIB registration method 130 // NEW: Safe XIB registration method
......