Toggle navigation
Toggle navigation
This project
Loading...
Sign in
open-source
/
warply_sdk_framework
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
Manos Chorianopoulos
2025-07-25 14:41:53 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
846b59d3baf58eed078639d4a556e2be558b82b6
846b59d3
1 parent
25d8cb08
CouponSet press handling
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
18 deletions
SwiftWarplyFramework/SwiftWarplyFramework/cells/MyRewardsOffersScrollTableViewCell/MyRewardsOffersScrollTableViewCell.swift
SwiftWarplyFramework/SwiftWarplyFramework/screens/MyRewardsViewController/MyRewardsViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/cells/MyRewardsOffersScrollTableViewCell/MyRewardsOffersScrollTableViewCell.swift
View file @
846b59d
...
...
@@ -9,6 +9,7 @@ import UIKit
protocol
MyRewardsOffersScrollTableViewCellDelegate
:
AnyObject
{
func
didSelectOffer
(
_
offer
:
OfferModel
)
func
didSelectCouponSet
(
_
couponSet
:
CouponSetItemModel
)
}
@objc(MyRewardsOffersScrollTableViewCell)
...
...
@@ -184,20 +185,8 @@ extension MyRewardsOffersScrollTableViewCell: UICollectionViewDataSource, UIColl
switch
data
.
itemType
{
case
.
couponSets
:
if
let
couponSet
=
items
[
indexPath
.
row
]
as?
CouponSetItemModel
{
// Convert CouponSetItemModel to OfferModel for delegate compatibility
let
offer
=
OfferModel
(
category
:
""
,
title
:
couponSet
.
name
??
""
,
description
:
couponSet
.
short_description
??
""
,
discount
:
couponSet
.
discount
??
""
,
discountType
:
couponSet
.
discount_type
??
""
,
bannerImage
:
couponSet
.
img_preview
??
""
,
merchantLogo
:
couponSet
.
img
?
.
first
??
""
,
expirationDate
:
couponSet
.
expiration
??
""
,
color
:
0x000000
,
isFavorite
:
false
)
delegate
?
.
didSelectOffer
(
offer
)
// Pass CouponSetItemModel directly to new delegate method
delegate
?
.
didSelectCouponSet
(
couponSet
)
}
default
:
// Handle OfferModel directly for ProfileViewController compatibility
...
...
SwiftWarplyFramework/SwiftWarplyFramework/screens/MyRewardsViewController/MyRewardsViewController.swift
View file @
846b59d
...
...
@@ -253,10 +253,10 @@ import UIKit
}
private
func
openCouponViewController
(
with
offer
:
OfferModel
)
{
let
vc
=
SwiftWarplyFramework
.
CouponViewController
(
nibName
:
"CouponViewController"
,
bundle
:
Bundle
.
frameworkBundle
)
vc
.
coupon
=
offer
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
//
let vc = SwiftWarplyFramework.CouponViewController(nibName: "CouponViewController", bundle: Bundle.frameworkBundle)
//
vc.coupon = offer
// self.navigationController?.pushViewController(vc, animated: true)
print
(
"CouponViewController navigation commented out - will handle later"
)
}
private
func
openProfileViewController
()
{
...
...
@@ -366,4 +366,9 @@ extension MyRewardsViewController: MyRewardsOffersScrollTableViewCellDelegate {
// Navigate to CouponViewController
openCouponViewController
(
with
:
offer
)
}
func
didSelectCouponSet
(
_
couponSet
:
CouponSetItemModel
)
{
// New logic for CouponSetItemModel - will handle navigation later
print
(
"CouponSet selected:
\(
couponSet
.
_name
)
"
)
}
}
...
...
Please
register
or
login
to post a comment