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
Manos Chorianopoulos
2022-04-21 10:35:08 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
0560faa5f7a01b2908b29e4b9257d260c07a714d
0560faa5
1 parent
41917b66
open webview from gifts
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
4 deletions
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS/GiftsView.swift
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS/GiftsView.swift
View file @
0560faa
...
...
@@ -11,6 +11,7 @@ import SwiftUI
import
Combine
import
Foundation
import
UIKit
import
WarplySDKFrameworkIOS
class
CouponSetItemModel
{
...
...
@@ -304,13 +305,20 @@ extension GiftsView {
var
item
:
CampaignItemModel
var
isFirst
:
Bool
var
isLast
:
Bool
var
parentView
:
UIView
var
uiscreen
=
UIScreen
.
main
.
bounds
var
body
:
some
View
{
Button
{
// GiftItem Action
print
(
"GiftItem tapped!"
)
let
instanceOfMyApi
=
MyApi
()
let
campaignViewController
=
instanceOfMyApi
.
openCampaign
(
parentView
,
campaign
:
item
.
index_url
)
!
campaignViewController
.
view
.
tag
=
6
// addChild(couponsViewController)
campaignViewController
.
view
.
frame
=
parentView
.
frame
parentView
.
addSubview
(
campaignViewController
.
view
)
campaignViewController
.
didMove
(
toParent
:
UIHostingController
(
rootView
:
self
))
}
label
:
{
HStack
(
alignment
:
.
center
)
{
...
...
@@ -338,6 +346,7 @@ extension GiftsView {
struct
giftsContainer
:
View
{
@State
var
gifts
:
Array
<
CampaignItemModel
>
=
[]
@State
var
title
:
String
=
""
@State
var
parentView
:
UIView
var
uiscreen
=
UIScreen
.
main
.
bounds
...
...
@@ -357,7 +366,7 @@ extension GiftsView {
HStack
(
alignment
:
.
center
)
{
ForEach
(
Array
(
gifts
.
enumerated
()),
id
:
\
.
offset
)
{
index
,
item
in
giftItemView
(
item
:
item
,
isFirst
:
index
==
0
,
isLast
:
index
==
(
gifts
.
count
-
1
))
giftItemView
(
item
:
item
,
isFirst
:
index
==
0
,
isLast
:
index
==
(
gifts
.
count
-
1
)
,
parentView
:
parentView
)
}
}
...
...
@@ -529,12 +538,12 @@ struct GiftsView: View {
ScrollView
(
showsIndicators
:
false
)
{
VStack
{
if
(
campains
.
filter
{
$0
.
subcategory
==
"gifts"
}
.
count
)
>
0
{
giftsContainer
(
gifts
:
campains
.
filter
{
$0
.
subcategory
==
"gifts"
},
title
:
"ΔΩΡΑ"
)
giftsContainer
(
gifts
:
campains
.
filter
{
$0
.
subcategory
==
"gifts"
},
title
:
"ΔΩΡΑ"
,
parentView
:
parentView
)
}
if
(
campains
.
filter
{
$0
.
subcategory
==
"rewards"
}
.
count
)
>
0
{
giftsContainer
(
gifts
:
campains
.
filter
{
$0
.
subcategory
==
"rewards"
},
title
:
"ΕΠΙΒΡΑΒΕΥΣΕΙΣ"
)
giftsContainer
(
gifts
:
campains
.
filter
{
$0
.
subcategory
==
"rewards"
},
title
:
"ΕΠΙΒΡΑΒΕΥΣΕΙΣ"
,
parentView
:
parentView
)
}
if
(
coupons
.
count
)
>
0
{
...
...
Please
register
or
login
to post a comment