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
2024-04-03 10:58:35 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
803127470bb9476f3dde3771d79b7e3441c6a37c
80312747
1 parent
c7c00cf3
fix CouponsVC coupons reload
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
11 deletions
SwiftWarplyFramework/SwiftWarplyFramework/CouponsViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/CouponsViewController.swift
View file @
8031274
...
...
@@ -23,6 +23,16 @@ import SwiftEventBus
self
.
hidesBottomBarWhenPushed
=
true
SwiftEventBus
.
onBackgroundThread
(
self
,
name
:
"coupons_fetched"
)
{
result
in
DispatchQueue
.
main
.
async
{
self
.
coupons
=
swiftApi
()
.
getCouponList
()
self
.
tableView
.
reloadData
()
self
.
handleEmptyView
()
}
}
getCouponsRequest
()
setBackButton
()
...
...
@@ -50,6 +60,13 @@ import SwiftEventBus
self
.
coupons
=
swiftApi
()
.
getCouponList
()
self
.
tableView
.
reloadData
()
self
.
handleEmptyView
()
self
.
navigationController
?
.
hideHairline
()
}
// MARK: - Functions
func
handleEmptyView
()
{
if
(
self
.
coupons
.
count
==
0
)
{
self
.
emptyView
.
isHidden
=
false
self
.
emptyViewHeight
.
constant
=
self
.
emptyView
.
intrinsicContentSize
.
height
...
...
@@ -57,11 +74,8 @@ import SwiftEventBus
self
.
emptyView
.
isHidden
=
true
self
.
emptyViewHeight
.
constant
=
0
}
self
.
navigationController
?
.
hideHairline
()
}
// MARK: - API Functions
func
getCouponsRequest
()
{
swiftApi
()
.
getCouponsAsync
(
getCouponsCallback
,
failureCallback
:
{
errorCode
in
...
...
@@ -77,15 +91,9 @@ import SwiftEventBus
DispatchQueue
.
main
.
async
{
SwiftEventBus
.
post
(
"coupons_fetched"
)
self
.
tableView
.
reloadData
()
//
self.tableView.reloadData()
if
(
self
.
coupons
.
count
==
0
)
{
self
.
emptyView
.
isHidden
=
false
self
.
emptyViewHeight
.
constant
=
self
.
emptyView
.
intrinsicContentSize
.
height
}
else
{
self
.
emptyView
.
isHidden
=
true
self
.
emptyViewHeight
.
constant
=
0
}
// self.handleEmptyView()
}
}
else
{
self
.
coupons
=
[]
...
...
Please
register
or
login
to post a comment