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-27 14:50:45 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
65d70db2e3353189f1e0549055a028bfd149d7d1
65d70db2
1 parent
38cf72bc
mfy added
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
149 additions
and
7 deletions
WarplySDKFrameworkIOS/Media.xcassets/MFY_container.imageset/Contents.json
WarplySDKFrameworkIOS/Media.xcassets/MFY_container.imageset/MFY_container-1.png
WarplySDKFrameworkIOS/Media.xcassets/MFY_container.imageset/MFY_container-2.png
WarplySDKFrameworkIOS/Media.xcassets/MFY_container.imageset/MFY_container.png
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS.xcworkspace/xcuserdata/billskouras.xcuserdatad/UserInterfaceState.xcuserstate
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS/CouponsView.swift
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS/MoreForYouView.swift
WarplySDKFrameworkIOS/Media.xcassets/MFY_container.imageset/Contents.json
0 → 100644
View file @
65d70db
{
"images"
:
[
{
"filename"
:
"MFY_container.png"
,
"idiom"
:
"universal"
,
"scale"
:
"1x"
},
{
"filename"
:
"MFY_container-1.png"
,
"idiom"
:
"universal"
,
"scale"
:
"2x"
},
{
"filename"
:
"MFY_container-2.png"
,
"idiom"
:
"universal"
,
"scale"
:
"3x"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
WarplySDKFrameworkIOS/Media.xcassets/MFY_container.imageset/MFY_container-1.png
0 → 100644
View file @
65d70db
3.51 KB
WarplySDKFrameworkIOS/Media.xcassets/MFY_container.imageset/MFY_container-2.png
0 → 100644
View file @
65d70db
3.51 KB
WarplySDKFrameworkIOS/Media.xcassets/MFY_container.imageset/MFY_container.png
0 → 100644
View file @
65d70db
3.51 KB
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS.xcworkspace/xcuserdata/billskouras.xcuserdatad/UserInterfaceState.xcuserstate
View file @
65d70db
No preview for this file type
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS/CouponsView.swift
View file @
65d70db
...
...
@@ -48,7 +48,7 @@ class DataModel {
var
getData
:
Array
<
NSDictionary
>
{
get
{
// getter
return
data
return
data
.
filter
({
$0
[
"status"
]
as!
String
==
"1"
})
}
}
}
...
...
@@ -219,7 +219,7 @@ struct CouponsView: View {
var
body
:
some
View
{
VStack
{
headerView
(
goBack
:
goBack
)
ScrollView
{
ScrollView
(
showsIndicators
:
false
)
{
VStack
{
if
(
data
.
count
)
>
0
{
ForEach
(
Array
(
zip
(
data
.
indices
,
data
)),
id
:
\
.
0
)
{
index
,
result
in
...
...
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS/MoreForYouView.swift
View file @
65d70db
...
...
@@ -4,10 +4,30 @@
//
// Created by Βασιλης Σκουρας on 20/4/22.
//
import
SwiftUI
import
Combine
import
Foundation
import
UIKit
class
DataMFYModel
{
var
data
:
Array
<
NSDictionary
>
=
[]
init
()
{
//initializer method
let
instanceOfMyApi
=
MyApi
()
let
inbox
=
instanceOfMyApi
.
getInbox
()
as!
Array
<
NSDictionary
>
data
=
inbox
.
filter
({
$0
[
"offer_category"
]
as!
String
==
"more_for_you"
})
}
var
getData
:
Array
<
NSDictionary
>
{
get
{
// getter
return
data
}
}
}
extension
MoreForYouView
{
struct
headerView
:
View
{
var
goBack
:
()
->
()
var
uiscreen
=
UIScreen
.
main
.
bounds
...
...
@@ -19,7 +39,7 @@ extension MoreForYouView {
HStack
{
Image
(
"ic_back"
,
bundle
:
Bundle
(
for
:
MyEmptyClass
.
self
))
.
resizable
()
.
frame
(
width
:
self
.
uiscreen
.
height
*
0.022
,
height
:
self
.
uiscreen
.
height
*
0.0
2
)
.
frame
(
width
:
self
.
uiscreen
.
height
*
0.022
,
height
:
self
.
uiscreen
.
height
*
0.0
4
)
.
offset
(
y
:
self
.
uiscreen
.
height
*
0.015
)
}
}
...
...
@@ -31,25 +51,124 @@ extension MoreForYouView {
.
frame
(
width
:
self
.
uiscreen
.
width
,
height
:
self
.
uiscreen
.
height
*
0.1
)
}
}
struct
ImageView
:
View
{
@ObservedObject
var
imageLoader
:
UrlImageModel
@State
var
width
:
CGFloat
@State
var
height
:
CGFloat
@State
var
isFill
:
Bool
var
uiscreen
=
UIScreen
.
main
.
bounds
init
(
withURL
url
:
String
,
width
:
CGFloat
,
height
:
CGFloat
,
isFill
:
Bool
)
{
imageLoader
=
UrlImageModel
(
urlString
:
url
)
self
.
width
=
width
self
.
height
=
height
self
.
isFill
=
isFill
}
var
body
:
some
View
{
Image
(
uiImage
:
imageLoader
.
image
??
UIImage
())
.
resizable
()
.
frame
(
minWidth
:
self
.
uiscreen
.
width
*
0.95
,
idealWidth
:
self
.
uiscreen
.
width
*
0.95
,
maxWidth
:
self
.
uiscreen
.
width
*
0.95
,
minHeight
:
self
.
uiscreen
.
height
*
0.2
,
idealHeight
:
self
.
uiscreen
.
height
*
0.2
,
maxHeight
:
self
.
uiscreen
.
height
*
0.2
,
alignment
:
.
leading
)
.
scaledToFill
()
.
aspectRatio
(
contentMode
:
isFill
?
.
fill
:
.
fit
)
.
cornerRadius
(
4
)
}
}
struct
inboxView
:
View
{
var
result
:
NSDictionary
var
index
:
Int
var
uiscreen
=
UIScreen
.
main
.
bounds
static
func
localizedWithParameter
(
parameter
:
String
)
->
LocalizedStringKey
{
return
"
\(
parameter
)
"
}
var
body
:
some
View
{
HStack
{
VStack
(
alignment
:
.
leading
)
{
Text
(
MoreForYouView
.
inboxView
.
localizedWithParameter
(
parameter
:
result
[
"title"
]
as?
String
??
""
))
.
frame
(
maxWidth
:
self
.
uiscreen
.
width
*
0.65
,
alignment
:
.
topLeading
)
.
padding
(
.
top
,
self
.
uiscreen
.
height
*
0.01
)
.
padding
(
.
leading
,
self
.
uiscreen
.
width
*
0.03
)
Spacer
()
Text
(
MoreForYouView
.
inboxView
.
localizedWithParameter
(
parameter
:
result
[
"subtitle"
]
as?
String
??
""
))
.
frame
(
maxWidth
:
self
.
uiscreen
.
width
*
0.72
,
alignment
:
.
topLeading
)
.
padding
(
.
leading
,
self
.
uiscreen
.
width
*
0.03
)
.
padding
(
.
bottom
,
self
.
uiscreen
.
height
*
0.01
)
}
.
frame
(
width
:
self
.
uiscreen
.
width
*
0.85
,
height
:
self
.
uiscreen
.
height
*
0.2
,
alignment
:
.
leading
)
.
background
(
Image
(
"MFY_container"
,
bundle
:
Bundle
(
for
:
MyEmptyClass
.
self
))
.
resizable
()
.
frame
(
minWidth
:
self
.
uiscreen
.
width
*
0.85
,
idealWidth
:
self
.
uiscreen
.
width
*
0.85
,
maxWidth
:
self
.
uiscreen
.
width
*
0.85
,
minHeight
:
self
.
uiscreen
.
height
*
0.2
,
idealHeight
:
self
.
uiscreen
.
height
*
0.2
,
maxHeight
:
self
.
uiscreen
.
height
*
0.2
,
alignment
:
.
leading
)
.
scaledToFill
()
.
aspectRatio
(
contentMode
:
.
fill
)
)
.
cornerRadius
(
4
,
corners
:
[
.
topLeft
,
.
bottomLeft
])
Spacer
()
}
.
frame
(
width
:
self
.
uiscreen
.
width
*
0.95
,
height
:
self
.
uiscreen
.
height
*
0.2
)
.
background
(
ImageView
(
withURL
:
result
[
"logo_url"
]
as!
String
,
width
:
self
.
uiscreen
.
width
*
0.95
,
height
:
self
.
uiscreen
.
height
*
0.2
,
isFill
:
true
)
)
.
padding
(
.
bottom
,
self
.
uiscreen
.
height
*
0.01
)
}
}
}
extension
Color
{
init
(
hex
:
Int
,
opacity
:
Double
=
1.0
)
{
let
red
=
Double
((
hex
&
0xff0000
)
>>
16
)
/
255.0
let
green
=
Double
((
hex
&
0xff00
)
>>
8
)
/
255.0
let
blue
=
Double
((
hex
&
0xff
)
>>
0
)
/
255.0
self
.
init
(
.
sRGB
,
red
:
red
,
green
:
green
,
blue
:
blue
,
opacity
:
opacity
)
}
}
struct
MoreForYouView
:
View
{
var
data
:
Array
<
NSDictionary
>
=
DataMFYModel
()
.
getData
var
parentView
:
UIView
var
uiscreen
=
UIScreen
.
main
.
bounds
func
goBack
(){
for
subview
in
parentView
.
subviews
{
if
(
subview
.
tag
==
1
)
{
if
(
subview
.
tag
==
4
)
{
subview
.
removeFromSuperview
()
}
}
}
var
body
:
some
View
{
headerView
(
goBack
:
goBack
)
Text
(
"More For you"
)
VStack
{
headerView
(
goBack
:
goBack
)
ScrollView
(
showsIndicators
:
false
)
{
VStack
{
if
(
data
.
count
)
>
0
{
ForEach
(
Array
(
zip
(
data
.
indices
,
data
)),
id
:
\
.
0
)
{
index
,
result
in
inboxView
(
result
:
result
,
index
:
index
)
}
}
}
.
padding
(
.
top
,
self
.
uiscreen
.
height
*
0.04
)
.
padding
(
.
bottom
,
self
.
uiscreen
.
height
*
0.05
)
}
.
frame
(
width
:
self
.
uiscreen
.
width
,
height
:
self
.
uiscreen
.
height
*
0.9
)
.
background
(
LinearGradient
(
gradient
:
Gradient
(
colors
:
[
Color
(
hex
:
0x1AADCC
),
Color
(
hex
:
0x83C062
)]),
startPoint
:
.
top
,
endPoint
:
.
bottom
)
)
}
.
frame
(
width
:
self
.
uiscreen
.
width
,
height
:
self
.
uiscreen
.
height
)
}
}
...
...
Please
register
or
login
to post a comment