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-15 12:12:31 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a8c07b5a8af03612466614b2730347c502f72c54
a8c07b5a
1 parent
5bd44f00
update ProfileModel
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
1 deletions
SwiftWarplyFramework/SwiftWarplyFramework/CouponsTableViewCell.swift
SwiftWarplyFramework/SwiftWarplyFramework/ViewControllerExtensions.swift
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
SwiftWarplyFramework/SwiftWarplyFramework/CouponsTableViewCell.swift
View file @
a8c07b5
...
...
@@ -49,7 +49,7 @@ import UIKit
couponImage
.
load
(
link
:
couponSetData
?
.
img_preview
??
""
,
placeholder
:
UIImage
(),
cache
:
URLCache
())
nameLabel
.
text
=
couponSetData
?
.
name
??
""
dicountLabel
.
text
=
(
coupon
.
discount
??
""
)
dicountLabel
.
text
=
(
coupon
.
discount
??
""
)
+
"€"
discriptionLabel
.
text
=
couponSetData
?
.
short_description
??
""
expirationLabel
.
text
=
"Ισχύει έως "
+
(
coupon
.
expiration
??
""
)
}
...
...
SwiftWarplyFramework/SwiftWarplyFramework/ViewControllerExtensions.swift
View file @
a8c07b5
...
...
@@ -190,3 +190,19 @@ extension UIView {
self
.
layer
.
insertSublayer
(
gradient
,
at
:
0
)
}
}
extension
UIViewController
{
func
setupToHideKeyboardOnTapOnView
()
{
let
tap
:
UITapGestureRecognizer
=
UITapGestureRecognizer
(
target
:
self
,
action
:
#selector(
UIViewController.dismissKeyboard
)
)
tap
.
cancelsTouchesInView
=
false
view
.
addGestureRecognizer
(
tap
)
}
@objc
func
dismissKeyboard
()
{
view
.
endEditing
(
true
)
}
}
...
...
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
View file @
a8c07b5
...
...
@@ -1091,6 +1091,7 @@ public class swiftApi {
// profile_metadata
public
let
badge
:
String
?
public
let
msisdnList
:
Array
<
String
>
?
public
init
()
{
...
...
@@ -1131,6 +1132,7 @@ public class swiftApi {
// profile_metadata
self
.
badge
=
""
self
.
msisdnList
=
[]
}
public
init
(
dictionary
:
[
String
:
Any
])
{
...
...
@@ -1180,14 +1182,17 @@ public class swiftApi {
profile_metadata_parsed
=
jsonArray
;
self
.
profile_metadata
=
profile_metadata_parsed
as?
[
String
:
Any
]?
??
[
String
:
Any
]()
self
.
badge
=
profile_metadata_parsed
[
"badge"
]
as?
String
?
??
""
self
.
msisdnList
=
profile_metadata_parsed
[
"msisdnList"
]
as?
Array
<
String
>
?
??
[]
}
else
{
self
.
profile_metadata
=
[
String
:
Any
]()
self
.
badge
=
""
self
.
msisdnList
=
[]
print
(
"bad json"
)
}
}
catch
let
error
as
NSError
{
self
.
profile_metadata
=
[
String
:
Any
]()
self
.
badge
=
""
self
.
msisdnList
=
[]
print
(
error
)
}
...
...
Please
register
or
login
to post a comment