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
2026-03-02 18:08:08 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
8c6d28a08cf15c7bac6187d8795f89eb8671b5f3
8c6d28a0
1 parent
825c7a60
retrieveCoupon success action
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
1 deletions
SwiftWarplyFramework/SwiftWarplyFramework/screens/CouponsetViewController/CouponsetViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/screens/CouponsetViewController/CouponsetViewController.swift
View file @
8c6d28a
...
...
@@ -175,10 +175,34 @@ import UIKit
}
let
alert
=
UIAlertController
(
title
:
"Επιτυχία"
,
message
:
message
,
preferredStyle
:
.
alert
)
alert
.
addAction
(
UIAlertAction
(
title
:
"OK"
,
style
:
.
default
,
handler
:
nil
))
alert
.
addAction
(
UIAlertAction
(
title
:
"OK"
,
style
:
.
default
,
handler
:
{
[
weak
self
]
_
in
self
?
.
navigateToCouponViewController
(
couponCode
:
couponCode
,
expiration
:
expiration
)
}))
present
(
alert
,
animated
:
true
,
completion
:
nil
)
}
private
func
navigateToCouponViewController
(
couponCode
:
String
,
expiration
:
String
)
{
// Build a CouponItemModel from the retrieve response + current couponset
let
couponDict
:
[
String
:
Any
]
=
[
"coupon"
:
couponCode
,
"expiration"
:
expiration
,
"status"
:
1
,
"couponset_uuid"
:
couponset
?
.
_uuid
??
""
]
let
couponItem
=
CouponItemModel
(
dictionary
:
couponDict
)
// Attach the couponset data so CouponViewController can display name, image, description, terms, etc.
if
let
couponsetData
=
couponset
{
couponItem
.
setCouponSetData
(
couponsetData
)
}
// Navigate to CouponViewController
let
couponVC
=
CouponViewController
()
couponVC
.
coupon
=
couponItem
self
.
navigationController
?
.
pushViewController
(
couponVC
,
animated
:
true
)
}
private
func
showErrorAlert
(
message
:
String
)
{
let
alert
=
UIAlertController
(
title
:
"Σφάλμα"
,
message
:
message
,
preferredStyle
:
.
alert
)
alert
.
addAction
(
UIAlertAction
(
title
:
"OK"
,
style
:
.
default
,
handler
:
nil
))
...
...
Please
register
or
login
to post a comment