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
2025-05-27 13:43:38 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
db0f7952da4f6d04a9bad15efe2171d4045a3931
db0f7952
1 parent
bec81137
contest press handling
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
76 additions
and
28 deletions
SwiftWarplyFramework/Pods/Pods.xcodeproj/xcuserdata/manos.xcuserdatad/xcschemes/xcschememanagement.plist
SwiftWarplyFramework/SwiftWarplyFramework.xcodeproj/xcuserdata/manos.xcuserdatad/xcschemes/xcschememanagement.plist
SwiftWarplyFramework/SwiftWarplyFramework.xcworkspace/xcuserdata/manos.xcuserdatad/UserInterfaceState.xcuserstate
SwiftWarplyFramework/SwiftWarplyFramework/ViewControllerExtensions.swift
SwiftWarplyFramework/SwiftWarplyFramework/cells/MyRewardsBannerOffersScrollTableViewCell/MyRewardsBannerOffersScrollTableViewCell.swift
SwiftWarplyFramework/SwiftWarplyFramework/screens/CampaignViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/screens/MyRewardsViewController/MyRewardsViewController.swift
SwiftWarplyFramework/Pods/Pods.xcodeproj/xcuserdata/manos.xcuserdatad/xcschemes/xcschememanagement.plist
View file @
db0f795
...
...
@@ -7,7 +7,7 @@
<key>
Pods-SwiftWarplyFramework.xcscheme_^#shared#^_
</key>
<dict>
<key>
orderHint
</key>
<integer>
0
</integer>
<integer>
1
</integer>
</dict>
</dict>
</dict>
...
...
SwiftWarplyFramework/SwiftWarplyFramework.xcodeproj/xcuserdata/manos.xcuserdatad/xcschemes/xcschememanagement.plist
View file @
db0f795
...
...
@@ -7,7 +7,7 @@
<key>
SwiftWarplyFramework.xcscheme_^#shared#^_
</key>
<dict>
<key>
orderHint
</key>
<integer>
1
</integer>
<integer>
0
</integer>
</dict>
</dict>
</dict>
...
...
SwiftWarplyFramework/SwiftWarplyFramework.xcworkspace/xcuserdata/manos.xcuserdatad/UserInterfaceState.xcuserstate
View file @
db0f795
No preview for this file type
SwiftWarplyFramework/SwiftWarplyFramework/ViewControllerExtensions.swift
View file @
db0f795
...
...
@@ -48,7 +48,7 @@ extension UIViewController {
//your custom view for back image with custom size
let
view
=
UIView
(
frame
:
CGRect
(
x
:
0
,
y
:
0
,
width
:
40
,
height
:
40
))
let
imageView
=
UIImageView
(
frame
:
CGRect
(
x
:
10
,
y
:
1
0
,
width
:
18
,
height
:
18
))
let
imageView
=
UIImageView
(
frame
:
CGRect
(
x
:
10
,
y
:
1
2
,
width
:
15
,
height
:
15
))
if
let
imgBackArrow
=
UIImage
(
named
:
icon
,
in
:
MyEmptyClass
.
resourceBundle
(),
compatibleWith
:
nil
)
{
imageView
.
image
=
imgBackArrow
...
...
@@ -149,31 +149,31 @@ extension UIViewController {
self
.
navigationController
?
.
navigationBar
.
layer
.
shadowRadius
=
2
}
func
setNavigationTitle
(
_
title
:
String
,
_
fontWeight
:
String
?
=
"
medium
"
)
{
func
setNavigationTitle
(
_
title
:
String
,
_
fontWeight
:
String
?
=
"
bold
"
)
{
let
uiscreen
:
CGRect
=
UIScreen
.
main
.
bounds
let
titleLabel
=
UILabel
(
frame
:
CGRect
(
x
:
0
,
y
:
0
,
width
:
uiscreen
.
width
*
0.7
,
height
:
uiscreen
.
height
*
0.03
))
titleLabel
.
text
=
title
titleLabel
.
textColor
=
UIColor
(
r
ed
:
0.13
,
green
:
0.13
,
blue
:
0.13
,
alpha
:
1.00
)
titleLabel
.
textColor
=
UIColor
(
r
gb
:
0x0D1B29
)
// Fix width for ipad
if
UIDevice
.
current
.
userInterfaceIdiom
==
.
pad
{
// iPad
if
(
fontWeight
==
"bold"
)
{
titleLabel
.
font
=
UIFont
(
name
:
"PingLCG-Bold"
,
size
:
2
1
)
titleLabel
.
font
=
UIFont
(
name
:
"PingLCG-Bold"
,
size
:
2
0
)
}
else
{
titleLabel
.
font
=
UIFont
(
name
:
"PingLCG-Bold"
,
size
:
2
1
)
titleLabel
.
font
=
UIFont
(
name
:
"PingLCG-Bold"
,
size
:
2
0
)
}
}
else
{
// not iPad (iPhone, mac, tv, carPlay, unspecified)
if
(
fontWeight
==
"bold"
)
{
titleLabel
.
font
=
UIFont
(
name
:
"PingLCG-Bold"
,
size
:
1
9
)
titleLabel
.
font
=
UIFont
(
name
:
"PingLCG-Bold"
,
size
:
1
8
)
}
else
{
titleLabel
.
font
=
UIFont
(
name
:
"PingLCG-Bold"
,
size
:
1
9
)
titleLabel
.
font
=
UIFont
(
name
:
"PingLCG-Bold"
,
size
:
1
8
)
}
}
titleLabel
.
adjustsFontSizeToFitWidth
=
true
titleLabel
.
textAlignment
=
.
center
titleLabel
.
textAlignment
=
.
left
self
.
navigationItem
.
titleView
=
titleLabel
}
...
...
SwiftWarplyFramework/SwiftWarplyFramework/cells/MyRewardsBannerOffersScrollTableViewCell/MyRewardsBannerOffersScrollTableViewCell.swift
View file @
db0f795
...
...
@@ -7,6 +7,10 @@
import
UIKit
protocol
MyRewardsBannerOffersScrollTableViewCellDelegate
:
AnyObject
{
func
didSelectBannerOffer
(
_
offer
:
OfferModel
)
}
@objc
public
class
MyRewardsBannerOffersScrollTableViewCell
:
UITableViewCell
{
@IBOutlet
weak
var
tagView1
:
UIView
!
@IBOutlet
weak
var
tagLabel1
:
UILabel
!
...
...
@@ -16,6 +20,7 @@ import UIKit
@IBOutlet
weak
var
collectionView
:
UICollectionView
!
@IBOutlet
weak
var
pageControl
:
UIPageControl
!
weak
var
delegate
:
MyRewardsBannerOffersScrollTableViewCellDelegate
?
var
data
:
SectionModel
?
public
override
func
awakeFromNib
()
{
...
...
@@ -92,7 +97,7 @@ import UIKit
}
}
extension
MyRewardsBannerOffersScrollTableViewCell
:
UICollectionViewDataSource
,
UICollectionViewDelegate
,
UICollectionViewDelegateFlowLayout
{
extension
MyRewardsBannerOffersScrollTableViewCell
:
UICollectionViewDataSource
,
UICollectionViewDelegate
,
UICollectionViewDelegateFlowLayout
,
UIScrollViewDelegate
{
public
func
numberOfSections
(
in
collectionView
:
UICollectionView
)
->
Int
{
...
...
@@ -113,7 +118,11 @@ extension MyRewardsBannerOffersScrollTableViewCell: UICollectionViewDataSource,
}
public
func
collectionView
(
_
collectionView
:
UICollectionView
,
didSelectItemAt
indexPath
:
IndexPath
)
{
// TODO: open offer
// Get the selected offer
if
let
offer
=
self
.
data
?
.
offers
[
indexPath
.
row
]
{
// Call the delegate method to notify the parent
delegate
?
.
didSelectBannerOffer
(
offer
)
}
}
// MARK: - UICollectionViewDelegateFlowLayout
...
...
SwiftWarplyFramework/SwiftWarplyFramework/screens/CampaignViewController.swift
View file @
db0f795
...
...
@@ -77,6 +77,7 @@ var timer2: DispatchSourceTimer?
if
(
showHeader
)
{
setBackButton
()
setNavigationTitle
(
"Προσφορά"
)
}
// Add observers for application state changes
...
...
SwiftWarplyFramework/SwiftWarplyFramework/screens/MyRewardsViewController/MyRewardsViewController.swift
View file @
db0f795
...
...
@@ -101,7 +101,7 @@ struct OfferModel {
discountType
:
"price"
,
bannerImage
:
"dominos_banner"
,
merchantLogo
:
"dominos_logo"
,
expirationDate
:
"έως 30
-
09"
,
expirationDate
:
"έως 30
/
09"
,
color
:
0xEE417D
,
isFavorite
:
true
),
...
...
@@ -113,7 +113,7 @@ struct OfferModel {
discountType
:
"percentage"
,
bannerImage
:
"dominos_banner"
,
merchantLogo
:
"dominos_logo"
,
expirationDate
:
"έως 30
-
09"
,
expirationDate
:
"έως 30
/
09"
,
color
:
0xEE417D
,
isFavorite
:
false
),
...
...
@@ -127,7 +127,7 @@ struct OfferModel {
// discountType: "percentage",
// bannerImage: "car_rental_banner",
// merchantLogo: "avis_logo",
// expirationDate: "έως 30
-
09",
// expirationDate: "έως 30
/
09",
// color: 0xEE417D,
// isFavorite: true
// ),
...
...
@@ -139,7 +139,7 @@ struct OfferModel {
// discountType: "amount",
// bannerImage: "hotel_banner",
// merchantLogo: "booking_logo",
// expirationDate: "έως 30
-
09",
// expirationDate: "έως 30
/
09",
// color: 0xEE417D,
// isFavorite: true
// ),
...
...
@@ -153,7 +153,7 @@ struct OfferModel {
discountType
:
"percentage"
,
bannerImage
:
"musa_banner"
,
merchantLogo
:
"musa_logo"
,
expirationDate
:
"έως 30
-
09"
,
expirationDate
:
"έως 30
/
09"
,
color
:
0x09914E
,
isFavorite
:
false
),
...
...
@@ -165,7 +165,7 @@ struct OfferModel {
discountType
:
"percentage"
,
bannerImage
:
"musa_banner"
,
merchantLogo
:
"musa_logo"
,
expirationDate
:
"έως 30
-
09"
,
expirationDate
:
"έως 30
/
09"
,
color
:
0x09914E
,
isFavorite
:
true
),
...
...
@@ -179,7 +179,7 @@ struct OfferModel {
discountType
:
"percentage"
,
bannerImage
:
"ranch_banner"
,
merchantLogo
:
"ranch_logo"
,
expirationDate
:
"έως 30
-
09"
,
expirationDate
:
"έως 30
/
09"
,
color
:
0xFC9F25
,
isFavorite
:
false
),
...
...
@@ -191,7 +191,7 @@ struct OfferModel {
discountType
:
"buyOneGetOne"
,
bannerImage
:
"ranch_banner"
,
merchantLogo
:
"ranch_logo"
,
expirationDate
:
"έως 30
-
09"
,
expirationDate
:
"έως 30
/
09"
,
color
:
0xFC9F25
,
isFavorite
:
false
),
...
...
@@ -205,7 +205,7 @@ struct OfferModel {
discountType
:
"amount"
,
bannerImage
:
"coffeeisland_banner"
,
merchantLogo
:
"coffeeisland_logo"
,
expirationDate
:
"έως 30
-
09"
,
expirationDate
:
"έως 30
/
09"
,
color
:
0xEE417D
,
isFavorite
:
false
),
...
...
@@ -217,7 +217,7 @@ struct OfferModel {
discountType
:
"percentage"
,
bannerImage
:
"coffeeisland_banner"
,
merchantLogo
:
"coffeeisland_logo"
,
expirationDate
:
"έως 30
-
09"
,
expirationDate
:
"έως 30
/
09"
,
color
:
0xEE417D
,
isFavorite
:
false
),
...
...
@@ -231,7 +231,7 @@ struct OfferModel {
discountType
:
"percentage"
,
bannerImage
:
"ninemia_banner"
,
merchantLogo
:
"ninemia_logo"
,
expirationDate
:
"έως 30
-
09"
,
expirationDate
:
"έως 30
/
09"
,
color
:
0xEE417D
,
isFavorite
:
true
),
...
...
@@ -243,7 +243,7 @@ struct OfferModel {
discountType
:
"percentage"
,
bannerImage
:
"ninemia_banner"
,
merchantLogo
:
"ninemia_logo"
,
expirationDate
:
"έως 30
-
09"
,
expirationDate
:
"έως 30
/
09"
,
color
:
0xEE417D
,
isFavorite
:
false
),
...
...
@@ -257,7 +257,7 @@ struct OfferModel {
discountType
:
"percentage"
,
bannerImage
:
"moustakas_banner"
,
merchantLogo
:
"moustakas_logo"
,
expirationDate
:
"έως 30
-
09"
,
expirationDate
:
"έως 30
/
09"
,
color
:
0xEE417D
,
isFavorite
:
false
),
...
...
@@ -269,7 +269,7 @@ struct OfferModel {
discountType
:
"buyOneGetOne"
,
bannerImage
:
"moustakas_banner"
,
merchantLogo
:
"moustakas_logo"
,
expirationDate
:
"έως 30
-
09"
,
expirationDate
:
"έως 30
/
09"
,
color
:
0xEE417D
,
isFavorite
:
false
),
...
...
@@ -283,7 +283,7 @@ struct OfferModel {
discountType
:
"amount"
,
bannerImage
:
"migato_banner"
,
merchantLogo
:
"migato_logo"
,
expirationDate
:
"έως 30
-
09"
,
expirationDate
:
"έως 30
/
09"
,
color
:
0xEE417D
,
isFavorite
:
false
),
...
...
@@ -295,7 +295,7 @@ struct OfferModel {
discountType
:
"percentage"
,
bannerImage
:
"migato_banner"
,
merchantLogo
:
"migato_logo"
,
expirationDate
:
"έως 30
-
09"
,
expirationDate
:
"έως 30
/
09"
,
color
:
0xEE417D
,
isFavorite
:
false
)
...
...
@@ -314,6 +314,9 @@ struct OfferModel {
public
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
// Hide the navigation bar
// self.navigationController?.setNavigationBarHidden(true, animated: false)
// Register XIBs for table view cells
tableView
.
register
(
UINib
(
nibName
:
"MyRewardsBannerOffersScrollTableViewCell"
,
bundle
:
Bundle
(
for
:
MyEmptyClass
.
self
)),
forCellReuseIdentifier
:
"MyRewardsBannerOffersScrollTableViewCell"
)
tableView
.
register
(
UINib
(
nibName
:
"MyRewardsOffersScrollTableViewCell"
,
bundle
:
Bundle
(
for
:
MyEmptyClass
.
self
)),
forCellReuseIdentifier
:
"MyRewardsOffersScrollTableViewCell"
)
...
...
@@ -328,6 +331,21 @@ struct OfferModel {
initializeSections
()
}
public
override
func
viewWillAppear
(
_
animated
:
Bool
)
{
super
.
viewWillAppear
(
animated
)
// Hide navigation bar when this view appears
self
.
navigationController
?
.
setNavigationBarHidden
(
true
,
animated
:
animated
)
}
public
override
func
viewWillDisappear
(
_
animated
:
Bool
)
{
super
.
viewWillDisappear
(
animated
)
// Show navigation bar when leaving this view (for other screens)
self
.
navigationController
?
.
setNavigationBarHidden
(
false
,
animated
:
animated
)
}
// MARK: Function
func
initializeSections
()
{
// Banner Offers (for the promotional banner at the top)
...
...
@@ -405,6 +423,17 @@ struct OfferModel {
self
.
tableView
.
reloadData
()
}
// Add navigation method
private
func
openCampaignViewController
(
with
offer
:
OfferModel
)
{
let
storyboard
=
UIStoryboard
(
name
:
"Main"
,
bundle
:
Bundle
(
for
:
MyEmptyClass
.
self
))
if
let
vc
=
storyboard
.
instantiateViewController
(
withIdentifier
:
"CampaignViewController"
)
as?
SwiftWarplyFramework
.
CampaignViewController
{
vc
.
campaignUrl
=
"https://warply.s3.amazonaws.com/dei/campaigns/DehEasterContest_stage/index.html"
vc
.
showHeader
=
true
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
// self.present(vc, animated: true)
}
}
}
// MARK: - TableView
...
...
@@ -442,6 +471,7 @@ extension MyRewardsViewController: UITableViewDelegate, UITableViewDataSource{
public
func
tableView
(
_
tableView
:
UITableView
,
cellForRowAt
indexPath
:
IndexPath
)
->
UITableViewCell
{
if
(
indexPath
.
section
==
0
)
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"MyRewardsBannerOffersScrollTableViewCell"
,
for
:
indexPath
)
as!
MyRewardsBannerOffersScrollTableViewCell
cell
.
delegate
=
self
cell
.
configureCell
(
data
:
self
.
bannerOffersSection
)
// cell.parent = self
return
cell
...
...
@@ -495,3 +525,11 @@ extension MyRewardsViewController: UITableViewDelegate, UITableViewDataSource{
}
}
}
// Add delegate conformance
extension
MyRewardsViewController
:
MyRewardsBannerOffersScrollTableViewCellDelegate
{
func
didSelectBannerOffer
(
_
offer
:
OfferModel
)
{
// Navigate to CampaignViewController
openCampaignViewController
(
with
:
offer
)
}
}
...
...
Please
register
or
login
to post a comment