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-06-29 15:31:38 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
0f789cb73428b1faf09eac0e0ed21c4fe927ef4e
0f789cb7
1 parent
8d546d55
update GiftsViewController
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
24 deletions
SwiftWarplyFramework/SwiftWarplyFramework/GiftsViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/GiftsViewController.swift
View file @
0f789cb
...
...
@@ -12,14 +12,12 @@ import UIKit
@IBOutlet
weak
var
mainView
:
UIView
!
@IBOutlet
weak
var
tableView
:
UITableView
!
public
var
campaigns
:
Array
<
swiftApi
.
CampaignItemModel
>
=
[]
public
var
campaigns
:
Array
<
swiftApi
.
CampaignItemModel
>
=
swiftApi
()
.
getCampaignList
()
.
filter
{
$0
.
offer_category
==
"gifts_for_you"
}
public
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
getCampaignsRequest
()
setBackButton
()
setNavigationTitle
(
"GIFTS for YOU"
)
...
...
@@ -39,24 +37,6 @@ import UIKit
}
func
getCampaignsRequest
()
{
swiftApi
()
.
getCampaignsAsync
(
getCampaignsCallback
)
}
func
getCampaignsCallback
(
_
campaignsData
:
Array
<
swiftApi
.
CampaignItemModel
>
?)
->
Void
{
if
(
campaignsData
!=
nil
)
{
self
.
campaigns
=
campaignsData
?
.
filter
{
$0
.
offer_category
==
"gifts_for_you"
}
??
[]
DispatchQueue
.
main
.
async
{
self
.
tableView
.
reloadData
()
swiftApi
()
.
setUniqueCampaignList
(
campaignsData
??
[])
}
}
else
{
self
.
campaigns
=
[]
}
}
}
// MARK: - TableView
...
...
@@ -87,11 +67,11 @@ extension GiftsViewController: UITableViewDelegate, UITableViewDataSource{
let
storyboard
=
UIStoryboard
(
name
:
"Main"
,
bundle
:
Bundle
(
for
:
MyEmptyClass
.
self
))
let
vc
=
storyboard
.
instantiateViewController
(
withIdentifier
:
"CampaignViewController"
)
as!
SwiftWarplyFramework
.
CampaignViewController
var
url
=
""
let
hasLoyaltyCampaignId
=
campaigns
[
indexPath
.
row
]
.
loyaltyCampaignId
!=
nil
&&
campaigns
[
indexPath
.
row
]
.
loyaltyCampaignId
!=
""
let
isCcmsOffer
=
(
campaigns
[
indexPath
.
row
]
.
ccms_offer
!=
nil
)
&&
(
campaigns
[
indexPath
.
row
]
.
ccms_offer
!=
""
)
&&
(
campaigns
[
indexPath
.
row
]
.
ccms_offer
==
"true"
)
if
(
hasLoyaltyCampaignId
)
{
if
(
isCcmsOffer
)
{
let
ccmsCampaigns
=
swiftApi
()
.
getCCMSLoyaltyCampaigns
()
let
loyaltyCampaignIdExists
=
ccmsCampaigns
.
contains
{
$0
.
_loyaltyCampaignId
==
campaigns
[
indexPath
.
row
]
.
loyaltyCampaignI
d
}
let
loyaltyCampaignIdExists
=
ccmsCampaigns
.
contains
{
$0
.
_loyaltyCampaignId
==
campaigns
[
indexPath
.
row
]
.
session_uui
d
}
if
(
loyaltyCampaignIdExists
==
true
)
{
var
ccmsCampaignFound
:
swiftApi
.
LoyaltyContextualOfferModel
=
swiftApi
.
LoyaltyContextualOfferModel
()
...
...
Please
register
or
login
to post a comment