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-08-09 16:09:36 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
4a8ab43c410a2ee7a17dcc3a1ec50970874dfa7e
4a8ab43c
1 parent
513fc921
add set getMerchantList, refactor getCoupons
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
1 deletions
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
View file @
4a8ab43
...
...
@@ -23,6 +23,7 @@ public struct GlobalVariables {
static
var
dealsSum
:
Float
=
0.0
static
var
seasonalList
:
Array
<
swiftApi
.
LoyaltyGiftsForYouPackage
>
=
[]
static
var
savedSteps
:
Int
=
0
static
var
merchantList
:
Array
<
swiftApi
.
MerchantModel
>
=
[]
}
var
timer
:
DispatchSourceTimer
?
...
...
@@ -500,7 +501,17 @@ public class swiftApi {
var
couponSetsArray
:
Array
<
CouponSetItemModel
>
=
[]
let
instanceOfMyApi
=
MyApi
()
instanceOfMyApi
.
getCouponsWithSuccessBlock
(
couponsCallback
,
failureBlock
:
(
couponsFailureCallback
))
swiftApi
()
.
getMultilingualMerchantsAsync
([],
false
,
0.0
,
[],
""
,
0
,
[],
getMerchantsCallback
)
func
getMerchantsCallback
(
_
merchantsData
:
Array
<
swiftApi
.
MerchantModel
>
?)
->
Void
{
if
(
merchantsData
!=
nil
)
{
DispatchQueue
.
main
.
async
{
swiftApi
()
.
setMerchantList
(
merchantsData
??
[])
instanceOfMyApi
.
getCouponsWithSuccessBlock
(
couponsCallback
,
failureBlock
:
(
couponsFailureCallback
))
}
}
else
{
}
}
func
couponsCallback
(
_
couponsData
:
[
AnyHashable
:
Any
]?)
->
Void
{
coupons
=
couponsData
??
[
""
:
""
]
...
...
@@ -4632,5 +4643,15 @@ public class swiftApi {
// }
}
public
func
setMerchantList
(
_
merchants
:
Array
<
MerchantModel
>
)
{
GlobalVariables
.
merchantList
=
merchants
}
public
func
getMerchantList
()
->
Array
<
MerchantModel
>
{
return
GlobalVariables
.
merchantList
}
}
...
...
Please
register
or
login
to post a comment