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
Vasilis
2022-04-20 16:17:32 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
90969079b1353c894e1ee0d5a9dbd448b0d95c0d
90969079
1 parent
7e1720a8
fixes in couponsview
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
6 deletions
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS.xcworkspace/xcuserdata/billskouras.xcuserdatad/UserInterfaceState.xcuserstate
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS/CouponsView.swift
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS.xcworkspace/xcuserdata/billskouras.xcuserdatad/UserInterfaceState.xcuserstate
View file @
9096907
No preview for this file type
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS/CouponsView.swift
View file @
9096907
...
...
@@ -92,6 +92,15 @@ struct ImageView: View {
}
}
struct
VLine
:
Shape
{
func
path
(
in
rect
:
CGRect
)
->
Path
{
Path
{
path
in
path
.
move
(
to
:
CGPoint
(
x
:
rect
.
midX
,
y
:
rect
.
minY
))
path
.
addLine
(
to
:
CGPoint
(
x
:
rect
.
midX
,
y
:
rect
.
maxY
))
}
}
}
extension
CouponsView
{
struct
headerView
:
View
{
var
goBack
:
()
->
()
...
...
@@ -104,13 +113,14 @@ extension CouponsView {
HStack
{
Image
(
"ic_back"
,
bundle
:
Bundle
(
for
:
MyEmptyClass
.
self
))
.
resizable
()
.
frame
(
width
:
self
.
uiscreen
.
height
*
0.02
5
,
height
:
self
.
uiscreen
.
height
*
0.02
)
.
offset
(
y
:
self
.
uiscreen
.
height
*
0.01
8
)
.
frame
(
width
:
self
.
uiscreen
.
height
*
0.02
2
,
height
:
self
.
uiscreen
.
height
*
0.02
)
.
offset
(
y
:
self
.
uiscreen
.
height
*
0.01
5
)
}
}
Text
(
"Όλα τα κουπόνια μου"
)
.
frame
(
width
:
self
.
uiscreen
.
width
*
0.8
,
height
:
self
.
uiscreen
.
height
*
0.025
,
alignment
:
.
center
)
.
offset
(
y
:
self
.
uiscreen
.
height
*
0.02
)
.
font
(
.
system
(
size
:
15
))
}
.
frame
(
width
:
self
.
uiscreen
.
width
,
height
:
self
.
uiscreen
.
height
*
0.1
)
}
...
...
@@ -126,15 +136,31 @@ extension CouponsView {
return
"
\(
parameter
)
"
}
static
func
convertDateFormat
(
inputDate
:
String
)
->
String
{
let
olDateFormatter
=
DateFormatter
()
olDateFormatter
.
dateFormat
=
"yyyy-MM-dd hh:mm:ss"
let
oldDate
=
olDateFormatter
.
date
(
from
:
inputDate
)
let
convertDateFormatter
=
DateFormatter
()
convertDateFormatter
.
dateFormat
=
"dd/MM/yyyy"
return
convertDateFormatter
.
string
(
from
:
oldDate
!
)
}
var
body
:
some
View
{
VStack
(
alignment
:
.
leading
)
{
HStack
(
alignment
:
.
center
)
{
ImageView
(
withURL
:
result
[
"img_preview"
]
as!
String
)
.
frame
(
maxWidth
:
self
.
uiscreen
.
width
*
0.15
)
.
padding
(
.
leading
,
self
.
uiscreen
.
width
*
0.04
)
Rectangle
()
.
frame
(
width
:
1
,
height
:
self
.
uiscreen
.
height
*
0.1
*
0.93
)
VLine
()
.
stroke
(
style
:
StrokeStyle
(
lineWidth
:
1
,
dash
:
[
5
]))
.
foregroundColor
(
Color
(
red
:
0.4392156862745098
,
green
:
0.4392156862745098
,
blue
:
0.4392156862745098
))
.
frame
(
width
:
1
)
.
padding
(
.
leading
,
self
.
uiscreen
.
width
*
0.01
)
Spacer
()
VStack
{
Text
(
CouponsView
.
couponView
.
localizedWithParameter
(
parameter
:
result
[
"admin_name"
]
as?
String
??
""
))
...
...
@@ -143,7 +169,7 @@ extension CouponsView {
Text
(
CouponsView
.
couponView
.
localizedWithParameter
(
parameter
:
result
[
"discount"
]
as?
String
??
""
))
.
frame
(
maxWidth
:
self
.
uiscreen
.
width
*
0.35
,
maxHeight
:
self
.
uiscreen
.
height
*
0.05
,
alignment
:
.
leading
)
.
font
(
.
system
(
size
:
47
))
Text
(
CouponsView
.
couponView
.
localizedWithParameter
(
parameter
:
"Ισχύει εώς "
+
(
result
[
"expiration"
]
as?
String
??
""
)
.
components
(
separatedBy
:
[
" "
])
.
filter
({
!
$0
.
isEmpty
})[
0
]
))
Text
(
CouponsView
.
couponView
.
localizedWithParameter
(
parameter
:
"Ισχύει εώς "
+
CouponsView
.
couponView
.
convertDateFormat
(
inputDate
:
result
[
"expiration"
]
as?
String
??
""
)
))
.
frame
(
maxWidth
:
self
.
uiscreen
.
width
*
0.35
,
maxHeight
:
.
infinity
,
alignment
:
.
leading
)
.
font
(
.
system
(
size
:
10
))
}
...
...
@@ -164,7 +190,7 @@ extension CouponsView {
Image
(
"coupons_container"
,
bundle
:
Bundle
(
for
:
MyEmptyClass
.
self
))
.
resizable
()
)
.
padding
(
.
top
,
self
.
uiscreen
.
height
*
0.05
)
.
padding
(
.
bottom
,
self
.
uiscreen
.
height
*
0.04
)
}
}
...
...
@@ -198,6 +224,7 @@ struct CouponsView: View {
couponView
(
result
:
result
,
index
:
index
)
}
}
}
.
padding
(
.
top
,
self
.
uiscreen
.
height
*
0.05
)
}
.
frame
(
width
:
self
.
uiscreen
.
width
,
height
:
self
.
uiscreen
.
height
*
0.9
)
.
background
(
...
...
Please
register
or
login
to post a comment