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-13 15:26:00 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
94a0e139c9921bac88d65c9c50ba95972d2578d3
94a0e139
1 parent
2fd68c6d
add redeemCouponSetRequest alerts
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
1 deletions
SwiftWarplyFramework/SwiftWarplyFramework/CouponViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/CouponViewController.swift
View file @
94a0e13
...
...
@@ -90,11 +90,69 @@ import UIKit
if
(
response
!=
nil
)
{
DispatchQueue
.
main
.
async
{
if
(
response
?
.
getStatus
==
1
)
{
// Do something
self
.
showSuccessDialog
(
"Το κουπόνι σου ενεργοποιήθηκε"
,
"Μπορείς να το βρεις στην αρχική οθόνη της εφαρμογής και στην ενότητα ενεργά δώρα!"
)
swiftApi
()
.
getCouponsAsync
(
getCouponsCallback
)
func
getCouponsCallback
(
_
couponsData
:
Array
<
swiftApi
.
CouponItemModel
>
?)
->
Void
{
if
(
couponsData
!=
nil
)
{
DispatchQueue
.
main
.
async
{
print
(
"========= getCouponsRequest SUCCESSSS CouponViewController ========="
)
}
}
else
{
print
(
"========= getCouponsRequest ERROR CouponViewController ========="
)
}
}
}
else
if
(
response
?
.
getStatus
==
3
)
{
self
.
showDialog
(
"Αποτυχία"
,
"Το κουπόνι δεν είναι διαθέσιμο για αγορά"
)
}
else
if
(
response
?
.
getStatus
==
5
)
{
self
.
showDialog
(
"Αποτυχία"
,
"Δεν έχεις αρκετούς πόντους"
)
}
else
{
self
.
showDialog
(
"Αποτυχία"
,
"Κάτι πήγε στραβά"
)
}
}
}
else
{
self
.
showDialog
(
"Αποτυχία"
,
"Κάτι πήγε στραβά"
)
}
}
func
showSuccessDialog
(
_
alertTitle
:
String
,
_
alertSubTitle
:
String
)
->
Void
{
let
alert
=
UIAlertController
(
title
:
alertTitle
,
message
:
alertSubTitle
,
preferredStyle
:
.
alert
)
alert
.
addAction
(
UIAlertAction
(
title
:
"OK"
,
style
:
.
default
,
handler
:
{
action
in
switch
action
.
style
{
case
.
default
:
self
.
navigationController
?
.
popViewController
(
animated
:
true
)
case
.
cancel
:
print
(
"cancel"
)
case
.
destructive
:
print
(
"destructive"
)
}
}))
self
.
present
(
alert
,
animated
:
true
,
completion
:
nil
)
}
func
showDialog
(
_
alertTitle
:
String
,
_
alertSubTitle
:
String
)
->
Void
{
let
alert
=
UIAlertController
(
title
:
alertTitle
,
message
:
alertSubTitle
,
preferredStyle
:
.
alert
)
alert
.
addAction
(
UIAlertAction
(
title
:
"OK"
,
style
:
.
default
,
handler
:
{
action
in
switch
action
.
style
{
case
.
default
:
print
(
"default"
)
case
.
cancel
:
print
(
"cancel"
)
case
.
destructive
:
print
(
"destructive"
)
}
}))
self
.
present
(
alert
,
animated
:
true
,
completion
:
nil
)
}
// MARK: - Actions
...
...
Please
register
or
login
to post a comment