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-02 17:02:47 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
efab0210ee9dc46b9c39054190cf0a6ac4b775d7
efab0210
1 parent
d3068652
add ProfileViewController empty view
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
1 deletions
SwiftWarplyFramework/SwiftWarplyFramework/screens/ProfileViewController/ProfileViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/screens/ProfileViewController/ProfileViewController.swift
View file @
efab021
...
...
@@ -386,6 +386,50 @@ import UIKit
self
.
filteredOffersSection
=
activeOffersSection
}
}
// MARK: - Empty State Helper
private
func
getEmptyStateMessage
()
->
String
{
switch
couponFilterSelected
.
title
{
case
"Ενεργά"
:
return
"Δεν υπάρχουν διαθέσιμα ενεργά κουπόνια"
case
"Αγαπημένα"
:
return
"Δεν υπάρχουν διαθέσιμα αγαπημένα κουπόνια"
case
"Εξαργυρωμένα"
:
return
"Δεν υπάρχουν διαθέσιμα εξαργυρωμένα κουπόνια"
default
:
return
"Δεν υπάρχουν διαθέσιμα κουπόνια"
}
}
private
func
createEmptyStateCell
(
_
tableView
:
UITableView
,
indexPath
:
IndexPath
)
->
UITableViewCell
{
let
cell
=
UITableViewCell
(
style
:
.
default
,
reuseIdentifier
:
"EmptyStateCell"
)
cell
.
selectionStyle
=
.
none
cell
.
backgroundColor
=
.
clear
cell
.
contentView
.
backgroundColor
=
.
clear
// Remove any existing subviews
cell
.
contentView
.
subviews
.
forEach
{
$0
.
removeFromSuperview
()
}
let
label
=
UILabel
()
label
.
text
=
getEmptyStateMessage
()
label
.
font
=
UIFont
(
name
:
"PingLCG-Regular"
,
size
:
16
)
label
.
textColor
=
UIColor
(
rgb
:
0x8B8B8B
)
label
.
textAlignment
=
.
center
label
.
numberOfLines
=
0
label
.
translatesAutoresizingMaskIntoConstraints
=
false
cell
.
contentView
.
addSubview
(
label
)
NSLayoutConstraint
.
activate
([
label
.
topAnchor
.
constraint
(
equalTo
:
cell
.
contentView
.
topAnchor
,
constant
:
40
),
label
.
bottomAnchor
.
constraint
(
equalTo
:
cell
.
contentView
.
bottomAnchor
,
constant
:
-
40
),
label
.
leadingAnchor
.
constraint
(
equalTo
:
cell
.
contentView
.
leadingAnchor
,
constant
:
24
),
label
.
trailingAnchor
.
constraint
(
equalTo
:
cell
.
contentView
.
trailingAnchor
,
constant
:
-
24
)
])
return
cell
}
}
// MARK: - TableView
...
...
@@ -398,10 +442,19 @@ extension ProfileViewController: UITableViewDelegate, UITableViewDataSource {
public
func
tableView
(
_
tableView
:
UITableView
,
numberOfRowsInSection
section
:
Int
)
->
Int
{
// return 1
if
(
section
==
2
)
{
if
(
forYouOffersSection
?
.
count
??
0
>
0
)
{
return
1
}
else
{
return
0
}
}
if
(
section
<=
3
)
{
return
1
}
else
{
return
filteredOffersSection
?
.
itemCount
??
0
let
itemCount
=
filteredOffersSection
?
.
itemCount
??
0
// Show at least 1 row for empty state message when no coupons
return
itemCount
>
0
?
itemCount
:
1
}
}
...
...
@@ -451,6 +504,12 @@ extension ProfileViewController: UITableViewDelegate, UITableViewDataSource {
return
cell
}
else
{
// Check if the filtered section is empty — show empty state
let
itemCount
=
filteredOffersSection
?
.
itemCount
??
0
if
itemCount
==
0
{
return
createEmptyStateCell
(
tableView
,
indexPath
:
indexPath
)
}
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"ProfileCouponTableViewCell"
,
for
:
indexPath
)
as!
ProfileCouponTableViewCell
if
let
items
=
self
.
filteredOffersSection
?
.
items
,
indexPath
.
row
<
items
.
count
,
...
...
Please
register
or
login
to post a comment