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-09-06 13:26:03 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
4971b6fb49491aa7807d005200bcda7118e8b885
4971b6fb
1 parent
2014c701
navigate back to wallet after share coupon
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
1 deletions
SwiftWarplyFramework/SwiftWarplyFramework.xcworkspace/xcuserdata/manos.xcuserdatad/UserInterfaceState.xcuserstate
SwiftWarplyFramework/SwiftWarplyFramework/CouponBarcodeViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/ShareViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/ViewControllerExtensions.swift
SwiftWarplyFramework/SwiftWarplyFramework/WalletViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework.xcworkspace/xcuserdata/manos.xcuserdatad/UserInterfaceState.xcuserstate
View file @
4971b6f
No preview for this file type
SwiftWarplyFramework/SwiftWarplyFramework/CouponBarcodeViewController.swift
View file @
4971b6f
...
...
@@ -44,6 +44,7 @@ import AVFoundation
var
barcodeVisible
:
Bool
=
false
;
public
var
coupon
:
swiftApi
.
CouponItemModel
?
public
var
isFromWallet
:
Bool
?
=
false
public
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
...
...
@@ -235,6 +236,7 @@ import AVFoundation
let
storyboard
=
UIStoryboard
(
name
:
"Main"
,
bundle
:
Bundle
(
for
:
MyEmptyClass
.
self
))
let
vc
=
storyboard
.
instantiateViewController
(
withIdentifier
:
"ShareViewController"
)
as!
SwiftWarplyFramework
.
ShareViewController
vc
.
coupon
=
self
.
coupon
vc
.
isFromWallet
=
self
.
isFromWallet
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
}
...
...
SwiftWarplyFramework/SwiftWarplyFramework/ShareViewController.swift
View file @
4971b6f
...
...
@@ -26,6 +26,7 @@ import UIKit
let
uiscreen
:
CGRect
=
UIScreen
.
main
.
bounds
public
var
coupon
:
swiftApi
.
CouponItemModel
?
public
var
isFromWallet
:
Bool
?
=
false
var
selectedNumber
:
String
=
""
var
numbersList
:
Array
<
String
>
=
[]
...
...
@@ -163,6 +164,29 @@ import UIKit
}))
self
.
present
(
alert
,
animated
:
true
,
completion
:
nil
)
}
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
:
if
(
self
.
isFromWallet
==
true
)
{
self
.
popBack
(
3
)
}
else
{
print
(
"default"
)
}
case
.
cancel
:
print
(
"cancel"
)
case
.
destructive
:
print
(
"destructive"
)
}
}))
self
.
present
(
alert
,
animated
:
true
,
completion
:
nil
)
}
// MARK: - API Calls
func
getProfileRequest
()
{
...
...
@@ -189,7 +213,6 @@ import UIKit
if
(
response
!=
nil
)
{
DispatchQueue
.
main
.
async
{
if
(
response
?
.
getStatus
==
1
)
{
self
.
showDialog
(
"Συγχαρητήρια!"
,
"Μόλις έκανες δώρο ένα κουπόνι!"
)
swiftApi
()
.
getCouponsAsync
(
getCouponsCallback
)
...
...
@@ -197,6 +220,7 @@ import UIKit
if
(
couponsData
!=
nil
)
{
DispatchQueue
.
main
.
async
{
self
.
showSuccessDialog
(
"Συγχαρητήρια!"
,
"Μόλις έκανες δώρο ένα κουπόνι!"
)
}
}
else
{
}
...
...
SwiftWarplyFramework/SwiftWarplyFramework/ViewControllerExtensions.swift
View file @
4971b6f
...
...
@@ -63,6 +63,16 @@ extension UIViewController {
self
.
navigationItem
.
titleView
=
titleLabel
}
// pop back n viewcontroller
func
popBack
(
_
nb
:
Int
)
{
if
let
viewControllers
:
[
UIViewController
]
=
self
.
navigationController
?
.
viewControllers
{
guard
viewControllers
.
count
<
nb
else
{
self
.
navigationController
?
.
popToViewController
(
viewControllers
[
viewControllers
.
count
-
nb
],
animated
:
true
)
return
}
}
}
}
extension
String
{
...
...
SwiftWarplyFramework/SwiftWarplyFramework/WalletViewController.swift
View file @
4971b6f
...
...
@@ -412,6 +412,7 @@ extension WalletViewController: UITableViewDelegate, UITableViewDataSource{
let
storyboard
=
UIStoryboard
(
name
:
"Main"
,
bundle
:
Bundle
(
for
:
MyEmptyClass
.
self
))
let
vc
=
storyboard
.
instantiateViewController
(
withIdentifier
:
"CouponBarcodeViewController"
)
as!
SwiftWarplyFramework
.
CouponBarcodeViewController
vc
.
coupon
=
coupons
[
indexPath
.
row
]
vc
.
isFromWallet
=
true
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
}
...
...
Please
register
or
login
to post a comment