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-17 14:13:47 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
4e593ddd1299dde1853c42852544c4dad6ae470b
4e593ddd
1 parent
7cebfbe8
MyCouponsViewController part4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
0 deletions
SwiftWarplyFramework/SwiftWarplyFramework/screens/MyCouponsViewController/MyCouponsViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/screens/MyCouponsViewController/MyCouponsViewController.swift
View file @
4e593dd
...
...
@@ -220,6 +220,15 @@ import UIKit
couponFilterSelected
=
updatedSelected
}
// Update table footer — scrolls with content, never sticky
let
itemCount
=
filteredOffersSection
?
.
itemCount
??
0
if
itemCount
>
0
{
tableView
.
tableFooterView
=
createFooterView
(
count
:
itemCount
)
tableView
.
tableFooterView
?
.
frame
=
CGRect
(
x
:
0
,
y
:
0
,
width
:
tableView
.
bounds
.
width
,
height
:
44
)
}
else
{
tableView
.
tableFooterView
=
UIView
()
}
self
.
tableView
.
reloadData
()
}
...
...
@@ -282,6 +291,28 @@ import UIKit
}
}
private
func
createFooterView
(
count
:
Int
)
->
UIView
{
let
container
=
UIView
()
container
.
backgroundColor
=
.
clear
let
label
=
UILabel
()
label
.
font
=
UIFont
(
name
:
"PingLCG-Regular"
,
size
:
12
)
label
.
textColor
=
UIColor
(
rgb
:
0x9BA1A6
)
label
.
textAlignment
=
.
center
label
.
text
=
"
\(
count
)
coupons
\u{00B7}
Swipe left to remove"
label
.
translatesAutoresizingMaskIntoConstraints
=
false
container
.
addSubview
(
label
)
NSLayoutConstraint
.
activate
([
label
.
centerXAnchor
.
constraint
(
equalTo
:
container
.
centerXAnchor
),
label
.
centerYAnchor
.
constraint
(
equalTo
:
container
.
centerYAnchor
),
label
.
leadingAnchor
.
constraint
(
greaterThanOrEqualTo
:
container
.
leadingAnchor
,
constant
:
16
),
label
.
trailingAnchor
.
constraint
(
lessThanOrEqualTo
:
container
.
trailingAnchor
,
constant
:
-
16
)
])
return
container
}
private
func
createEmptyStateCell
(
_
tableView
:
UITableView
,
indexPath
:
IndexPath
)
->
UITableViewCell
{
let
cell
=
UITableViewCell
(
style
:
.
default
,
reuseIdentifier
:
"EmptyStateCell"
)
cell
.
selectionStyle
=
.
none
...
...
@@ -400,6 +431,16 @@ extension MyCouponsViewController: ProfileCouponFiltersTableViewCellDelegate {
func
didSelectFilter
(
_
filter
:
CouponFilterModel
)
{
self
.
couponFilterSelected
=
filter
handleFilterPress
(
with
:
filter
)
// Refresh table footer count for the newly selected filter
let
itemCount
=
filteredOffersSection
?
.
itemCount
??
0
if
itemCount
>
0
{
tableView
.
tableFooterView
=
createFooterView
(
count
:
itemCount
)
tableView
.
tableFooterView
?
.
frame
=
CGRect
(
x
:
0
,
y
:
0
,
width
:
tableView
.
bounds
.
width
,
height
:
44
)
}
else
{
tableView
.
tableFooterView
=
UIView
()
}
self
.
tableView
.
reloadData
()
}
}
...
...
Please
register
or
login
to post a comment