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-06-29 18:59:12 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
1194023a581a8fd4f8cdee0ed2fd11205ba0fab3
1194023a
1 parent
1fc8834f
add seasonals at GiftsVC
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
SwiftWarplyFramework/SwiftWarplyFramework/GiftsViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/GiftsViewController.swift
View file @
1194023
...
...
@@ -7,12 +7,14 @@
import
Foundation
import
UIKit
import
SwiftEventBus
@objc
public
class
GiftsViewController
:
UIViewController
{
@IBOutlet
weak
var
mainView
:
UIView
!
@IBOutlet
weak
var
tableView
:
UITableView
!
public
var
campaigns
:
Array
<
swiftApi
.
CampaignItemModel
>
=
swiftApi
()
.
getCampaignList
()
.
filter
{
$0
.
offer_category
==
"gifts_for_you"
}
public
var
seasonalList
:
Array
<
swiftApi
.
LoyaltyGiftsForYouPackage
>
=
swiftApi
()
.
getSeasonalList
()
public
override
func
viewDidLoad
()
{
...
...
@@ -20,6 +22,16 @@ import UIKit
self
.
hidesBottomBarWhenPushed
=
true
if
(
seasonalList
.
count
>
0
)
{
for
seasonalItem
in
seasonalList
{
let
newCampaign
=
swiftApi
.
CampaignItemModel
()
newCampaign
.
_title
=
seasonalItem
.
_title
newCampaign
.
_logo_url
=
seasonalItem
.
_imageUrl
newCampaign
.
_loyaltyPackageId
=
seasonalItem
.
_loyaltyPackageId
campaigns
.
append
(
newCampaign
)
}
}
setBackButton
()
setNavigationTitle
(
"GIFTS for YOU"
)
...
...
@@ -66,6 +78,7 @@ extension GiftsViewController: UITableViewDelegate, UITableViewDataSource{
}
public
func
tableView
(
_
tableView
:
UITableView
,
didSelectRowAt
indexPath
:
IndexPath
)
{
if
(
campaigns
[
indexPath
.
row
]
.
session_uuid
!=
nil
&&
campaigns
[
indexPath
.
row
]
.
session_uuid
!=
""
)
{
let
storyboard
=
UIStoryboard
(
name
:
"Main"
,
bundle
:
Bundle
(
for
:
MyEmptyClass
.
self
))
let
vc
=
storyboard
.
instantiateViewController
(
withIdentifier
:
"CampaignViewController"
)
as!
SwiftWarplyFramework
.
CampaignViewController
var
url
=
""
...
...
@@ -92,6 +105,14 @@ extension GiftsViewController: UITableViewDelegate, UITableViewDataSource{
}
vc
.
campaignUrl
=
url
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
}
else
{
let
seasonalEvent
=
swiftApi
.
LoyaltyGiftsForYouOfferClickEvent
()
seasonalEvent
.
_title
=
campaigns
[
indexPath
.
row
]
.
_title
??
""
seasonalEvent
.
_imageUrl
=
campaigns
[
indexPath
.
row
]
.
_logo_url
??
""
seasonalEvent
.
_loyaltyPackageId
=
campaigns
[
indexPath
.
row
]
.
_loyaltyPackageId
??
""
SwiftEventBus
.
post
(
"seasonal"
,
sender
:
seasonalEvent
)
}
}
}
...
...
Please
register
or
login
to post a comment