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 10:17:37 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
1a5f8607af6302a75ed856424501110e9db5b0f3
1a5f8607
1 parent
e51a3baa
revert of mistake at warply.m
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
10 deletions
WarplySDKFrameworkIOS/Warply/Warply.m
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS.xcworkspace/xcuserdata/billskouras.xcuserdatad/UserInterfaceState.xcuserstate
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS/CouponsView.swift
WarplySDKFrameworkIOS/Warply/Warply.m
View file @
1a5f860
This diff could not be displayed because it is too large.
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS.xcworkspace/xcuserdata/billskouras.xcuserdatad/UserInterfaceState.xcuserstate
View file @
1a5f860
No preview for this file type
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS/CouponsView.swift
View file @
1a5f860
...
...
@@ -9,7 +9,7 @@
import
SwiftUI
import
Combine
import
Foundation
import
UIKit
class
DataModel
{
var
data
:
Array
<
NSDictionary
>
=
[]
...
...
@@ -95,15 +95,22 @@ struct ImageView: View {
extension
CouponsView
{
struct
headerView
:
View
{
var
goBack
:
()
->
()
var
uiscreen
=
UIScreen
.
main
.
bounds
var
body
:
some
View
{
HStack
{
Button
(
action
:
goBack
)
{
HStack
{
Image
(
"ic_back"
,
bundle
:
Bundle
(
for
:
MyEmptyClass
.
self
))
.
resizable
()
.
frame
(
width
:
self
.
uiscreen
.
width
*
0.025
,
height
:
self
.
uiscreen
.
height
*
0.02
)
.
offset
(
x
:
-
self
.
uiscreen
.
width
/
2
+
self
.
uiscreen
.
width
*
0.05
,
y
:
self
.
uiscreen
.
height
*
0.04
)
// .offset(x: -self.uiscreen.width / 2 + self.uiscreen.width * 0.05, y: self.uiscreen.height * 0.04)
}
}
// .frame(width: self.uiscreen.width * 0.025, height: self.uiscreen.height * 0.02)
// .offset(x: -self.uiscreen.width / 2 + self.uiscreen.width * 0.05, y: self.uiscreen.height * 0.04)
Text
(
"Όλα τα κουπόνια μου"
)
.
frame
(
width
:
self
.
uiscreen
.
width
*
0.8
,
height
:
self
.
uiscreen
.
height
*
0.025
,
alignment
:
.
center
)
.
offset
(
y
:
self
.
uiscreen
.
height
*
0.04
)
...
...
@@ -127,22 +134,28 @@ extension CouponsView {
HStack
(
alignment
:
.
center
)
{
HStack
(
alignment
:
.
center
)
{
ImageView
(
withURL
:
result
[
"img_preview"
]
as!
String
)
.
frame
(
width
:
self
.
uiscreen
.
width
*
0.2
,
height
:
self
.
uiscreen
.
height
*
0.05
)
.
frame
(
maxWidth
:
self
.
uiscreen
.
width
*
0.2
)
// .offset(x: -self.uiscreen.width / 2 + self.uiscreen.width * 0.2, y: -self.uiscreen.height * 0.05 * 0.96)
// .padding(.leading, self.uiscreen.width * 0.05)
Rectangle
()
.
frame
(
width
:
1
,
height
:
self
.
uiscreen
.
height
*
0.1
*
0.93
)
// .offset(x: -self.uiscreen.width / 2 + self.uiscreen.width * 0.205, y: -self.uiscreen.height * 0.05 * 0.93)
VStack
{
Text
(
CouponsView
.
couponView
.
localizedWithParameter
(
parameter
:
result
[
"admin_name"
]
as!
String
))
Text
(
CouponsView
.
couponView
.
localizedWithParameter
(
parameter
:
result
[
"discount"
]
as!
String
))
Text
(
CouponsView
.
couponView
.
localizedWithParameter
(
parameter
:
"Ισχύει εώς "
+
(
result
[
"expiration"
]
as!
String
)
.
components
(
separatedBy
:
[
" "
])
.
filter
({
!
$0
.
isEmpty
})[
0
]))
Text
(
CouponsView
.
couponView
.
localizedWithParameter
(
parameter
:
result
[
"admin_name"
]
as?
String
??
""
))
.
frame
(
maxWidth
:
self
.
uiscreen
.
width
*
0.27
,
maxHeight
:
.
infinity
,
alignment
:
.
leading
)
Text
(
CouponsView
.
couponView
.
localizedWithParameter
(
parameter
:
result
[
"discount"
]
as?
String
??
""
))
.
frame
(
maxWidth
:
self
.
uiscreen
.
width
*
0.27
,
maxHeight
:
.
infinity
,
alignment
:
.
leading
)
Text
(
CouponsView
.
couponView
.
localizedWithParameter
(
parameter
:
"Ισχύει εώς "
+
(
result
[
"expiration"
]
as?
String
??
""
)
.
components
(
separatedBy
:
[
" "
])
.
filter
({
!
$0
.
isEmpty
})[
0
]))
.
frame
(
maxWidth
:
self
.
uiscreen
.
width
*
0.27
,
maxHeight
:
.
infinity
,
alignment
:
.
leading
)
}
.
frame
(
maxHeight
:
.
infinity
)
.
padding
(
.
top
,
self
.
uiscreen
.
height
*
0.03
)
.
padding
(
.
bottom
,
self
.
uiscreen
.
height
*
0.03
)
VStack
{
Text
(
CouponsView
.
couponView
.
localizedWithParameter
(
parameter
:
result
[
"short_description"
]
as!
String
))
}
.
frame
(
maxWidth
:
self
.
uiscreen
.
width
*
0.15
,
maxHeight
:
.
infinity
)
}
.
frame
(
maxWidth
:
self
.
uiscreen
.
width
*
0.25
,
maxHeight
:
.
infinity
)
}
.
frame
(
maxWidth
:
.
infinity
,
maxHeight
:
.
infinity
)
...
...
@@ -152,7 +165,7 @@ extension CouponsView {
Image
(
"coupons_container"
,
bundle
:
Bundle
(
for
:
MyEmptyClass
.
self
))
)
// .padding(.top, self.uiscreen.height * 0.05)
.
frame
(
width
:
self
.
uiscreen
.
width
*
0.9
,
height
:
self
.
uiscreen
.
height
*
0.1
)
.
frame
(
width
:
self
.
uiscreen
.
width
*
0.9
,
height
:
self
.
uiscreen
.
height
*
0.1
3
)
.
background
(
Color
.
purple
)
}
}
...
...
@@ -163,12 +176,22 @@ extension CouponsView {
struct
CouponsView
:
View
{
var
data
:
Array
<
NSDictionary
>
=
DataModel
()
.
getData
var
tag
:
String
=
"coupons"
var
parentView
:
UIView
var
uiscreen
=
UIScreen
.
main
.
bounds
func
goBack
(){
for
subview
in
parentView
.
subviews
{
if
(
subview
.
tag
==
1
)
{
subview
.
removeFromSuperview
()
}
}
}
var
body
:
some
View
{
VStack
{
headerView
()
headerView
(
goBack
:
goBack
)
ScrollView
{
VStack
{
if
(
data
.
count
)
>
0
{
...
...
Please
register
or
login
to post a comment