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
Dimitris Togias
2022-07-22 12:33:20 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
861f18dcf49c9d87492bb8098c1b00cf2627fc46
861f18dc
1 parent
32be2af1
fix sharing model parsing and apply in table cell
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
8 deletions
SwiftWarplyFramework/SwiftWarplyFramework/AnalysisItemViewCell.swift
SwiftWarplyFramework/SwiftWarplyFramework/SharingHistoryViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
SwiftWarplyFramework/SwiftWarplyFramework/AnalysisItemViewCell.swift
View file @
861f18d
...
...
@@ -40,11 +40,21 @@ extension AnalysisItemViewCell {
let
dateFormatter
=
DateFormatter
()
dateFormatter
.
dateFormat
=
"dd-MM-yyyy"
// dateLabel.text = dateFormatter.string(from: item.date)
if
let
date
=
item
.
date
{
let
dateString
=
dateFormatter
.
string
(
from
:
date
)
dateLabel
.
text
=
dateString
}
else
{
dateLabel
.
text
=
""
}
//itemImage.image =
// titleLabel.text = item.name
// priceLabel.text = String(format: "%.2f€", item.discount)
// subtitleLabel.text = item.subtitle
titleLabel
.
text
=
item
.
name
priceLabel
.
text
=
String
(
format
:
"%.2f€"
,
item
.
discount
)
if
(
"sent"
==
item
.
sharingType
)
{
subtitleLabel
.
text
=
String
(
format
:
"Εκπτωτικό κουπόνι προς @%"
,
"69740000000"
)
}
else
if
(
"received"
==
item
.
sharingType
)
{
subtitleLabel
.
text
=
String
(
format
:
"Εκπτωτικό κουπόνι από @%"
,
"69740000000"
)
}
}
}
...
...
SwiftWarplyFramework/SwiftWarplyFramework/SharingHistoryViewController.swift
View file @
861f18d
...
...
@@ -34,6 +34,7 @@ class SharingHistoryViewController: AnalysisChildViewController {
}
showLoading
()
// TODO: Implement API call
}
...
...
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
View file @
861f18d
...
...
@@ -457,18 +457,27 @@ public class swiftApi {
public
class
SharingCouponModel
:
Codable
{
public
let
transactionMetadata
:
String
?
public
let
sharingType
:
String
?
public
let
discount
:
String
?
public
let
date
:
String
?
public
let
discount
:
Float
public
let
date
:
Date
?
public
let
couponsetUuid
:
String
?
public
let
name
:
String
?
public
init
(
dictionary
:
[
String
:
Any
])
{
self
.
transactionMetadata
=
dictionary
[
"transaction_metadata"
]
as?
String
?
??
""
self
.
sharingType
=
dictionary
[
"sharing_type"
]
as?
String
?
??
""
self
.
discount
=
dictionary
[
"discount"
]
as?
String
?
??
""
self
.
date
=
dictionary
[
"date"
]
as?
String
?
??
""
self
.
discount
=
dictionary
[
"discount"
]
as?
Float
??
0.0
self
.
couponsetUuid
=
dictionary
[
"couponsetUuid"
]
as?
String
?
??
""
self
.
name
=
dictionary
[
"name"
]
as?
String
?
??
""
let
dateString
=
dictionary
[
"date"
]
as?
String
?
??
""
let
dateFormatter
=
DateFormatter
()
dateFormatter
.
dateFormat
=
"yyyy-MM-dd hh:mm:ss"
if
let
date
=
dateFormatter
.
date
(
from
:
dateString
??
""
)
{
self
.
date
=
date
}
else
{
self
.
date
=
nil
}
}
}
...
...
Please
register
or
login
to post a comment