Showing
2 changed files
with
12 additions
and
18 deletions
| ... | @@ -9,6 +9,7 @@ import UIKit | ... | @@ -9,6 +9,7 @@ import UIKit |
| 9 | 9 | ||
| 10 | protocol MyRewardsOffersScrollTableViewCellDelegate: AnyObject { | 10 | protocol MyRewardsOffersScrollTableViewCellDelegate: AnyObject { |
| 11 | func didSelectOffer(_ offer: OfferModel) | 11 | func didSelectOffer(_ offer: OfferModel) |
| 12 | + func didSelectCouponSet(_ couponSet: CouponSetItemModel) | ||
| 12 | } | 13 | } |
| 13 | 14 | ||
| 14 | @objc(MyRewardsOffersScrollTableViewCell) | 15 | @objc(MyRewardsOffersScrollTableViewCell) |
| ... | @@ -184,20 +185,8 @@ extension MyRewardsOffersScrollTableViewCell: UICollectionViewDataSource, UIColl | ... | @@ -184,20 +185,8 @@ extension MyRewardsOffersScrollTableViewCell: UICollectionViewDataSource, UIColl |
| 184 | switch data.itemType { | 185 | switch data.itemType { |
| 185 | case .couponSets: | 186 | case .couponSets: |
| 186 | if let couponSet = items[indexPath.row] as? CouponSetItemModel { | 187 | if let couponSet = items[indexPath.row] as? CouponSetItemModel { |
| 187 | - // Convert CouponSetItemModel to OfferModel for delegate compatibility | 188 | + // Pass CouponSetItemModel directly to new delegate method |
| 188 | - let offer = OfferModel( | 189 | + delegate?.didSelectCouponSet(couponSet) |
| 189 | - category: "", | ||
| 190 | - title: couponSet.name ?? "", | ||
| 191 | - description: couponSet.short_description ?? "", | ||
| 192 | - discount: couponSet.discount ?? "", | ||
| 193 | - discountType: couponSet.discount_type ?? "", | ||
| 194 | - bannerImage: couponSet.img_preview ?? "", | ||
| 195 | - merchantLogo: couponSet.img?.first ?? "", | ||
| 196 | - expirationDate: couponSet.expiration ?? "", | ||
| 197 | - color: 0x000000, | ||
| 198 | - isFavorite: false | ||
| 199 | - ) | ||
| 200 | - delegate?.didSelectOffer(offer) | ||
| 201 | } | 190 | } |
| 202 | default: | 191 | default: |
| 203 | // Handle OfferModel directly for ProfileViewController compatibility | 192 | // Handle OfferModel directly for ProfileViewController compatibility | ... | ... |
| ... | @@ -253,10 +253,10 @@ import UIKit | ... | @@ -253,10 +253,10 @@ import UIKit |
| 253 | } | 253 | } |
| 254 | 254 | ||
| 255 | private func openCouponViewController(with offer: OfferModel) { | 255 | private func openCouponViewController(with offer: OfferModel) { |
| 256 | - let vc = SwiftWarplyFramework.CouponViewController(nibName: "CouponViewController", bundle: Bundle.frameworkBundle) | 256 | + // let vc = SwiftWarplyFramework.CouponViewController(nibName: "CouponViewController", bundle: Bundle.frameworkBundle) |
| 257 | - vc.coupon = offer | 257 | + // vc.coupon = offer |
| 258 | - | 258 | + // self.navigationController?.pushViewController(vc, animated: true) |
| 259 | - self.navigationController?.pushViewController(vc, animated: true) | 259 | + print("CouponViewController navigation commented out - will handle later") |
| 260 | } | 260 | } |
| 261 | 261 | ||
| 262 | private func openProfileViewController() { | 262 | private func openProfileViewController() { |
| ... | @@ -366,4 +366,9 @@ extension MyRewardsViewController: MyRewardsOffersScrollTableViewCellDelegate { | ... | @@ -366,4 +366,9 @@ extension MyRewardsViewController: MyRewardsOffersScrollTableViewCellDelegate { |
| 366 | // Navigate to CouponViewController | 366 | // Navigate to CouponViewController |
| 367 | openCouponViewController(with: offer) | 367 | openCouponViewController(with: offer) |
| 368 | } | 368 | } |
| 369 | + | ||
| 370 | + func didSelectCouponSet(_ couponSet: CouponSetItemModel) { | ||
| 371 | + // New logic for CouponSetItemModel - will handle navigation later | ||
| 372 | + print("CouponSet selected: \(couponSet._name)") | ||
| 373 | + } | ||
| 369 | } | 374 | } | ... | ... |
-
Please register or login to post a comment