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-10-30 16:27:55 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
aa27d1141ca4908decb8fc8e740ef2e56c3f8c6b
aa27d114
1 parent
87374c2f
add img key to CouponSetItemModel
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
View file @
aa27d11
...
...
@@ -538,6 +538,7 @@ public class swiftApi {
public
let
uuid
:
String
?
public
let
admin_name
:
String
?
public
let
name
:
String
?
public
let
img
:
[
String
]?
public
let
img_preview
:
String
?
public
let
expiration
:
String
?
public
let
description
:
String
?
...
...
@@ -608,6 +609,32 @@ public class swiftApi {
self
.
expiration
=
""
}
// img Example
// img = "[\"https://warply.s3.amazonaws.com/applications/f83dfde1145e4c2da69793abb2f579af/couponset/00833266674d4a95b21dc4bf06995548/logo.png\"]";
if
let
imgString
=
dictionary
[
"img"
]
as?
String
{
// Convert the cleaned string to JSON data
if
let
imgData
=
imgString
.
data
(
using
:
.
utf8
)
{
do
{
// Parse JSON data as an array of dictionaries
if
let
imgArray
=
try
JSONSerialization
.
jsonObject
(
with
:
imgData
,
options
:
[])
as?
[
String
]
{
self
.
img
=
imgArray
}
else
{
self
.
img
=
[]
}
}
catch
{
self
.
img
=
[]
print
(
"Error parsing img:
\(
error
)
"
)
}
}
else
{
self
.
img
=
[]
}
}
else
{
self
.
img
=
[]
}
// shop_availability Example
// {"shop_availability":"[{\"merchant_uuid\": \"9742752bcf904a269707c40b286e66de\", \"product_url\": \"https://www.ab.gr/el/eshop/Galaktokomika-Fytika-Rofimata-and-Eidi-Psygeioy/Gala-and-Fytika-Rofimata/Fytika-Rofimata/Fytiko-Rofima-Amygdalo-Choris-Prosthiki-Zacharis-1lt/p/7438640\"}]"}
...
...
Please
register
or
login
to post a comment