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
2026-03-16 15:46:43 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
85920af984d6ad57c00ce1825399b6f1ffd6cc7c
85920af9
1 parent
7fa4d329
MyCouponsViewController
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
30 deletions
SwiftWarplyFramework/SwiftWarplyFramework/screens/MyCouponsViewController/MyCouponsViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/screens/MyRewardsViewController/MyRewardsViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/screens/MyCouponsViewController/MyCouponsViewController.swift
View file @
85920af
...
...
@@ -50,7 +50,7 @@ import UIKit
// Show navigation bar for this screen (with back button)
self
.
navigationController
?
.
setNavigationBarHidden
(
false
,
animated
:
false
)
setBackButton
()
setNavigationTitle
(
"Το προφίλ μου"
)
//
setNavigationTitle("Το προφίλ μου")
// UPDATED: Safe XIB registration with error handling
registerTableViewCells
()
...
...
@@ -73,8 +73,6 @@ import UIKit
private
func
registerTableViewCells
()
{
let
cellConfigs
=
[
(
"MyCouponsHeaderTableViewCell"
,
"MyCouponsHeaderTableViewCell"
),
(
"ProfileQuestionnaireTableViewCell"
,
"ProfileQuestionnaireTableViewCell"
),
(
"MyRewardsOffersScrollTableViewCell"
,
"MyRewardsOffersScrollTableViewCell"
),
(
"ProfileCouponFiltersTableViewCell"
,
"ProfileCouponFiltersTableViewCell"
),
(
"ProfileCouponTableViewCell"
,
"ProfileCouponTableViewCell"
)
]
...
...
@@ -273,7 +271,7 @@ extension MyCouponsViewController: UITableViewDelegate, UITableViewDataSource {
public
func
numberOfSections
(
in
tableView
:
UITableView
)
->
Int
{
// return 4 + (filteredOffersSection?.offers.count ?? 0)
return
5
return
3
}
public
func
tableView
(
_
tableView
:
UITableView
,
numberOfRowsInSection
section
:
Int
)
->
Int
{
...
...
@@ -320,18 +318,6 @@ extension MyCouponsViewController: UITableViewDelegate, UITableViewDataSource {
return
cell
}
else
if
(
indexPath
.
section
==
1
)
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"ProfileQuestionnaireTableViewCell"
,
for
:
indexPath
)
as!
ProfileQuestionnaireTableViewCell
return
cell
}
else
if
(
indexPath
.
section
==
2
)
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"MyRewardsOffersScrollTableViewCell"
,
for
:
indexPath
)
as!
MyRewardsOffersScrollTableViewCell
cell
.
delegate
=
self
// Set the offers delegate
cell
.
configureCell
(
data
:
self
.
forYouOffersSection
,
isInProfile
:
true
)
return
cell
}
else
if
(
indexPath
.
section
==
3
)
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"ProfileCouponFiltersTableViewCell"
,
for
:
indexPath
)
as!
ProfileCouponFiltersTableViewCell
cell
.
delegate
=
self
// Set the offers delegate
...
...
@@ -371,19 +357,6 @@ extension MyCouponsViewController: UITableViewDelegate, UITableViewDataSource {
}
// Add delegate conformance
extension
MyCouponsViewController
:
MyRewardsOffersScrollTableViewCellDelegate
{
func
didSelectOffer
(
_
offer
:
OfferModel
)
{
// Legacy OfferModel handling — no longer used but kept for protocol conformance
print
(
"⚠️ [MyCouponsVC] didSelectOffer called with legacy OfferModel — should not happen"
)
}
func
didSelectCouponSet
(
_
couponSet
:
CouponSetItemModel
)
{
// MyCouponsViewController doesn't handle coupon sets, so just log
print
(
"CouponSet selected in MyCouponsViewController:
\(
couponSet
.
_name
)
"
)
}
}
// Add delegate conformance
extension
MyCouponsViewController
:
ProfileCouponFiltersTableViewCellDelegate
{
func
didSelectFilter
(
_
filter
:
CouponFilterModel
)
{
self
.
couponFilterSelected
=
filter
...
...
SwiftWarplyFramework/SwiftWarplyFramework/screens/MyRewardsViewController/MyRewardsViewController.swift
View file @
85920af
...
...
@@ -122,7 +122,9 @@ import UIKit
}
@objc
private
func
myCouponsButtonTapped
()
{
// TODO: open CouponsVC
let
vc
=
SwiftWarplyFramework
.
MyCouponsViewController
(
nibName
:
"MyCouponsViewController"
,
bundle
:
Bundle
.
frameworkBundle
)
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
}
// NEW: Safe XIB registration method
...
...
Please
register
or
login
to post a comment