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-14 12:22:03 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
1c0f36284aecf0536cebb06500e47e31f1451f0c
1c0f3628
1 parent
befbfd8b
fix in data in coupons view
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
44 deletions
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS.xcworkspace/xcuserdata/billskouras.xcuserdatad/UserInterfaceState.xcuserstate
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS/CouponsView.swift
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS/MyApi.m
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS.xcworkspace/xcuserdata/billskouras.xcuserdatad/UserInterfaceState.xcuserstate
View file @
1c0f362
No preview for this file type
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS/CouponsView.swift
View file @
1c0f362
...
...
@@ -10,7 +10,7 @@ import SwiftUI
import
WarplySDKFrameworkIOS
class
DataModel
{
var
data
:
A
nyObject
?
var
data
:
A
rray
<
NSDictionary
>
?
init
()
{
//initializer method
let
instanceOfMyApi
=
MyApi
()
...
...
@@ -19,13 +19,13 @@ class DataModel {
if
let
myDictionary
=
coupons
as?
[
String
:
AnyObject
]
{
self
.
data
=
myDictionary
[
"result"
]
as
AnyObject
self
.
data
=
(
myDictionary
[
"result"
]
as!
Array
<
NSDictionary
>
)
}
}
var
getData
:
A
nyObject
?
{
var
getData
:
A
rray
<
NSDictionary
>
{
get
{
// getter
return
data
??
nil
return
data
??
[]
}
}
}
...
...
@@ -34,54 +34,65 @@ class DataModel {
@available(iOS 13.0.0, *)
struct
CouponsView
:
View
{
var
data
:
A
nyObject
?
=
DataModel
()
.
getData
var
data
:
A
rray
<
NSDictionary
>
=
DataModel
()
.
getData
var
uiscreen
=
UIScreen
.
main
.
bounds
// @State private var bottomRect: CGRect = .zero
var
body
:
some
View
{
ScrollView
{
VStack
{
ZStack
{
Image
(
"ic_back"
,
bundle
:
Bundle
(
identifier
:
"framework.warp.ly.warplySDKFrameworkIOS"
))
.
resizable
()
.
frame
(
width
:
self
.
uiscreen
.
height
*
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
)
}
.
frame
(
width
:
self
.
uiscreen
.
width
)
let
dataArray
:[
NSDictionary
]
=
(
data
as!
NSArray
)
.
compactMap
({
$0
as?
NSDictionary
})
ForEach
(
dataArray
,
id
:
\
.
self
)
{
item
in
VStack
{
ZStack
{
Image
(
"ic_back"
,
bundle
:
Bundle
(
identifier
:
"framework.warp.ly.warplySDKFrameworkIOS"
))
.
resizable
()
.
frame
(
width
:
self
.
uiscreen
.
height
*
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
)
.
frame
(
width
:
self
.
uiscreen
.
width
)
}
ScrollView
{
VStack
{
// let dataArray:[NSDictionary] = (data as! NSArray).compactMap({ $0 as? NSDictionary })
// if (data?.count())! > 0 {
// data?.forEach { (language) in
ForEach
(
data
,
id
:
\
.
self
)
{
result
in
ZStack
{
Image
(
"logo"
,
bundle
:
Bundle
(
identifier
:
"framework.warp.ly.warplySDKFrameworkIOS"
))
.
resizable
()
.
frame
(
width
:
self
.
uiscreen
.
height
*
0.04
,
height
:
self
.
uiscreen
.
height
*
0.04
,
alignment
:
.
topLeading
)
.
cornerRadius
(
CGFloat
(
self
.
uiscreen
.
height
*
0.02
))
.
offset
(
x
:
-
self
.
uiscreen
.
width
/
2
+
self
.
uiscreen
.
width
*
0.14
,
y
:
-
self
.
uiscreen
.
height
*
0.07
)
}
.
background
(
Image
(
"Background"
)
.
resizable
()
.
edgesIgnoringSafeArea
(
.
all
)
.
frame
(
width
:
UIScreen
.
main
.
bounds
.
width
,
height
:
UIScreen
.
main
.
bounds
.
height
)
)
ZStack
{
Image
(
"logo"
,
bundle
:
Bundle
(
identifier
:
"framework.warp.ly.warplySDKFrameworkIOS"
))
.
resizable
()
.
frame
(
width
:
self
.
uiscreen
.
height
*
0.04
,
height
:
self
.
uiscreen
.
height
*
0.04
,
alignment
:
.
topLeading
)
.
cornerRadius
(
CGFloat
(
self
.
uiscreen
.
height
*
0.02
))
.
offset
(
x
:
-
self
.
uiscreen
.
width
/
2
+
self
.
uiscreen
.
width
*
0.14
,
y
:
-
self
.
uiscreen
.
height
*
0.07
)
}
.
background
(
Image
(
"coupons_container"
,
bundle
:
Bundle
(
identifier
:
"framework.warp.ly.warplySDKFrameworkIOS"
))
.
resizable
()
.
edgesIgnoringSafeArea
(
.
all
)
.
frame
(
width
:
UIScreen
.
main
.
bounds
.
width
,
height
:
UIScreen
.
main
.
bounds
.
height
)
)
}
// } else {
// VStack {
// Text("No coupons available")
// .frame( width: self.uiscreen.width * 0.8, height: self.uiscreen.height * 0.04, alignment: .leading)
// .offset(y: -self.uiscreen.height * 0.03)
// .foregroundColor(.white)
// }
// }
}
Text
(
"Χριστίνα Γεωργίου"
)
.
frame
(
width
:
self
.
uiscreen
.
width
*
0.8
,
height
:
self
.
uiscreen
.
height
*
0.04
,
alignment
:
.
leading
)
.
offset
(
y
:
-
self
.
uiscreen
.
height
*
0.03
)
.
foregroundColor
(
.
white
)
}
Text
(
"Ενεργά κουπόνια"
)
.
frame
(
width
:
self
.
uiscreen
.
width
*
0.9
,
alignment
:
.
leading
)
// .offset(x: -self.uiscreen.width / 4 + self.uiscreen.width * 0.0025)
}
.
frame
(
width
:
self
.
uiscreen
.
width
,
height
:
self
.
uiscreen
.
height
)
.
frame
(
width
:
self
.
uiscreen
.
width
,
height
:
self
.
uiscreen
.
height
)
}
}
}
#endif
...
...
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS/MyApi.m
View file @
1c0f362
...
...
@@ -46,7 +46,7 @@ NSString *LANG;
LANG
=
lang
;
}
-
(
UIViewController
*
)
openCoupons
:
(
UIViewController
*
)
controller
:
(
UIWindow
*
)
window
{
-
(
UIViewController
*
)
openCoupons
{
UIViewController
*
couponsViewController
=
[
CouponsViewInterface
couponsViewController
];
// controller = [[UINavigationController alloc]initWithRootViewController:profileViewController];
...
...
Please
register
or
login
to post a comment