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
2022-07-12 18:35:10 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c2bef3d5efc5bde8cc03d2f331e634bade19c7c1
c2bef3d5
1 parent
56fa7ab6
fix rerender campaigns asynchronously
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
0 deletions
SwiftWarplyFramework/SwiftWarplyFramework/GiftsViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/MFYViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
SwiftWarplyFramework/SwiftWarplyFramework/GiftsViewController.swift
View file @
c2bef3d
...
...
@@ -37,6 +37,12 @@ import SwiftEventBus
tableView
.
delegate
=
self
tableView
.
dataSource
=
self
SwiftEventBus
.
onBackgroundThread
(
self
,
name
:
"ccms_retrieved"
)
{
result
in
print
(
"===== SwiftEventBus ccms_retrieved ====="
)
campaigns
=
swiftApi
()
.
mergeGFYCCMSLoyaltyCampaigns
(
campaigns
:
swiftApi
()
.
getCCMSLoyaltyCampaigns
())
tableView
.
reloadData
()
}
tableView
.
clipsToBounds
=
true
tableView
.
layer
.
cornerRadius
=
30
...
...
SwiftWarplyFramework/SwiftWarplyFramework/MFYViewController.swift
View file @
c2bef3d
...
...
@@ -25,6 +25,12 @@ import UIKit
tableView
.
delegate
=
self
tableView
.
dataSource
=
self
SwiftEventBus
.
onBackgroundThread
(
self
,
name
:
"ccms_retrieved"
)
{
result
in
print
(
"===== SwiftEventBus ccms_retrieved ====="
)
campaigns
=
swiftApi
()
.
mergeGFYCCMSLoyaltyCampaigns
(
campaigns
:
swiftApi
()
.
getCCMSLoyaltyCampaigns
())
tableView
.
reloadData
()
}
tableView
.
clipsToBounds
=
true
tableView
.
layer
.
cornerRadius
=
30
...
...
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
View file @
c2bef3d
...
...
@@ -7,6 +7,7 @@
import
Foundation
import
SwiftUI
import
SwiftEventBus
public
struct
GlobalVariables
{
static
var
campaigns
:
Array
<
swiftApi
.
CampaignItemModel
>
=
[]
...
...
@@ -73,6 +74,8 @@ public class swiftApi {
let
ccmsCampaign
:
Array
<
LoyaltyContextualOfferModel
>
=
campaigns
GlobalVariables
.
ccmsCampaigns
=
campaigns
SwiftEventBus
.
post
(
"ccms_retrieved"
)
}
public
func
mergeGFYCCMSLoyaltyCampaigns
(
campaigns
:
Array
<
LoyaltyContextualOfferModel
>
)
->
Array
<
CampaignItemModel
>
{
...
...
Please
register
or
login
to post a comment