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-05 15:47:57 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
5872b034578d5047279fc12cde17be75b62eb150
5872b034
1 parent
b9c584cc
filter segmented campaigns depending on badge
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
4 deletions
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
View file @
5872b03
...
...
@@ -2031,10 +2031,20 @@ public class swiftApi {
public
func
setCampaignList
(
_
campaigns
:
Array
<
CampaignItemModel
>
)
->
Void
{
let
userTag
=
self
.
getUserTag
()
var
campaignsArray
:
Array
<
CampaignItemModel
>
=
[]
for
item
in
campaigns
{
if
(((
item
.
_badge
==
nil
)
||
(
item
.
_badge
==
""
)))
{
campaignsArray
.
append
(
item
)
}
else
if
(
item
.
_badge
==
userTag
)
{
campaignsArray
.
append
(
item
)
}
}
if
((
userTag
!=
nil
)
&&
(
userTag
!=
""
))
{
GlobalVariables
.
campaigns
=
campaigns
.
filter
{
$0
.
offer_category
!=
"questionnaire"
}
GlobalVariables
.
campaigns
=
campaigns
Array
.
filter
{
$0
.
offer_category
!=
"questionnaire"
}
}
else
{
GlobalVariables
.
campaigns
=
campaigns
GlobalVariables
.
campaigns
=
campaigns
Array
}
}
...
...
@@ -2165,11 +2175,20 @@ public class swiftApi {
public
func
setUniqueCampaignList
(
_
campaigns
:
Array
<
CampaignItemModel
>
)
->
Void
{
let
userTag
=
self
.
getUserTag
()
var
campaignsArray
:
Array
<
CampaignItemModel
>
=
[]
for
item
in
campaigns
{
if
(((
item
.
_badge
==
nil
)
||
(
item
.
_badge
==
""
)))
{
campaignsArray
.
append
(
item
)
}
else
if
(
item
.
_badge
==
userTag
)
{
campaignsArray
.
append
(
item
)
}
}
if
((
userTag
!=
nil
)
&&
(
userTag
!=
""
))
{
GlobalVariables
.
campaigns
=
campaigns
.
filter
{
$0
.
offer_category
!=
"questionnaire"
}
GlobalVariables
.
campaigns
=
campaigns
Array
.
filter
{
$0
.
offer_category
!=
"questionnaire"
}
}
else
{
GlobalVariables
.
campaigns
=
campaigns
GlobalVariables
.
campaigns
=
campaigns
Array
}
}
...
...
Please
register
or
login
to post a comment