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-06-24 19:40:09 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
39a7a90611f5d1991dd098e9e252bd15b67c296a
39a7a906
1 parent
30a7c9ff
added couponEarnings dynamic data
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
SwiftWarplyFramework/SwiftWarplyFramework/WalletViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/WalletViewController.swift
View file @
39a7a90
...
...
@@ -94,9 +94,9 @@ import UIKit
couponEarnView
.
layer
.
shadowOpacity
=
1.0
couponEarnView
.
layer
.
shadowRadius
=
3.0
// TODO: dynamic
couponEarnLabel
.
text
=
"
Μέχρι τώρα έχεις κερδίσει 20,00€ σε προσφορές από 3 κουπόνια!
"
couponEarnAmountLabel
.
text
=
"
20,00€
"
couponEarnLabel
.
text
=
""
couponEarnAmountLabel
.
text
=
""
activeCodeView
.
layer
.
cornerRadius
=
5.0
activeCodeView
.
layer
.
shadowColor
=
UIColor
(
red
:
0.00
,
green
:
0.00
,
blue
:
0.00
,
alpha
:
0.16
)
.
cgColor
...
...
@@ -122,6 +122,13 @@ import UIKit
DispatchQueue
.
main
.
async
{
self
.
tableView
.
reloadData
()
var
totalCouponDiscount
=
self
.
coupons
.
reduce
(
0
)
{
$0
+
(
Float
(
$1
.
discount
??
""
)
??
0
)
}
totalCouponDiscount
=
Float
(
round
(
100
*
totalCouponDiscount
)
/
100
)
let
totalCouponDiscountString
=
String
(
format
:
"%.2f"
,
totalCouponDiscount
)
.
replacingOccurrences
(
of
:
"."
,
with
:
","
,
options
:
.
literal
,
range
:
nil
)
self
.
couponEarnLabel
.
text
=
"Μέχρι τώρα έχεις κερδίσει "
+
totalCouponDiscountString
+
"€ σε προσφορές από "
+
String
(
activeCouponData
.
count
)
+
" κουπόνια!"
self
.
couponEarnAmountLabel
.
text
=
totalCouponDiscountString
+
"€"
}
}
else
{
self
.
coupons
=
[]
...
...
Please
register
or
login
to post a comment