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-07-23 12:55:28 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
aed9e765b03297742ba114e9cc2ad8caf5fbcfd7
aed9e765
1 parent
c576dea3
MyRewardsBannerOffers dynamic banner image
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
11 deletions
SwiftWarplyFramework/SwiftWarplyFramework.xcworkspace/xcuserdata/manos.xcuserdatad/UserInterfaceState.xcuserstate
SwiftWarplyFramework/SwiftWarplyFramework/cells/MyRewardsBannerOfferCollectionViewCell/MyRewardsBannerOfferCollectionViewCell.swift
SwiftWarplyFramework/SwiftWarplyFramework/cells/MyRewardsBannerOffersScrollTableViewCell/MyRewardsBannerOffersScrollTableViewCell.xib
SwiftWarplyFramework/SwiftWarplyFramework.xcworkspace/xcuserdata/manos.xcuserdatad/UserInterfaceState.xcuserstate
View file @
aed9e76
No preview for this file type
SwiftWarplyFramework/SwiftWarplyFramework/cells/MyRewardsBannerOfferCollectionViewCell/MyRewardsBannerOfferCollectionViewCell.swift
View file @
aed9e76
...
...
@@ -11,19 +11,33 @@ import UIKit
public
class
MyRewardsBannerOfferCollectionViewCell
:
UICollectionViewCell
{
@IBOutlet
weak
var
backgroundImage
:
UIImageView
!
var
postImageURL
:
String
?
{
didSet
{
if
let
url
=
postImageURL
{
self
.
backgroundImage
.
image
=
UIImage
()
// UIImage(named: "loading")
UIImage
.
loadImageUsingCacheWithUrlString
(
url
)
{
image
in
// set the image only when we are still displaying the content for the image we finished downloading
if
url
==
self
.
postImageURL
{
self
.
backgroundImage
.
image
=
image
}
}
}
else
{
self
.
backgroundImage
.
image
=
nil
}
}
}
public
override
func
awakeFromNib
()
{
super
.
awakeFromNib
()
// Initialization code
backgroundImage
.
contentMode
=
.
scaleAspectFill
}
func
configureCell
(
data
:
CampaignItemModel
)
{
// Use campaign's banner image - no hardcoded defaults
let
imageName
=
data
.
_banner_img_mobile
??
""
if
!
imageName
.
isEmpty
{
backgroundImage
.
image
=
UIImage
(
named
:
imageName
,
in
:
Bundle
.
frameworkResourceBundle
,
compatibleWith
:
nil
)
}
else
{
backgroundImage
.
image
=
nil
}
self
.
postImageURL
=
data
.
_banner_img_mobile
??
""
}
}
...
...
SwiftWarplyFramework/SwiftWarplyFramework/cells/MyRewardsBannerOffersScrollTableViewCell/MyRewardsBannerOffersScrollTableViewCell.xib
View file @
aed9e76
...
...
@@ -17,7 +17,7 @@
<autoresizingMask
key=
"autoresizingMask"
/>
<subviews>
<view
contentMode=
"scaleToFill"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"VzF-dQ-3Wa"
userLabel=
"Parent View"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"413"
height=
"4
50
"
/>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"413"
height=
"4
65
"
/>
<subviews>
<view
contentMode=
"scaleToFill"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"JTs-J5-DO2"
userLabel=
"Top View"
>
<rect
key=
"frame"
x=
"24"
y=
"36"
width=
"365"
height=
"35"
/>
...
...
@@ -106,7 +106,7 @@
</constraints>
</view>
<collectionView
clipsSubviews=
"YES"
multipleTouchEnabled=
"YES"
contentMode=
"scaleToFill"
showsHorizontalScrollIndicator=
"NO"
showsVerticalScrollIndicator=
"NO"
dataMode=
"none"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"I7z-Fz-SNP"
>
<rect
key=
"frame"
x=
"0.0"
y=
"
76
"
width=
"413"
height=
"348"
/>
<rect
key=
"frame"
x=
"0.0"
y=
"
91
"
width=
"413"
height=
"348"
/>
<color
key=
"backgroundColor"
white=
"1"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"genericGamma22GrayColorSpace"
/>
<constraints>
<constraint
firstAttribute=
"height"
constant=
"348"
id=
"aEf-Xl-A2C"
/>
...
...
@@ -124,7 +124,7 @@
</connections>
</collectionView>
<pageControl
opaque=
"NO"
contentMode=
"scaleToFill"
contentHorizontalAlignment=
"center"
contentVerticalAlignment=
"center"
numberOfPages=
"3"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"lOm-CZ-dVG"
>
<rect
key=
"frame"
x=
"170"
y=
"4
24
"
width=
"73"
height=
"26"
/>
<rect
key=
"frame"
x=
"170"
y=
"4
39
"
width=
"73"
height=
"26"
/>
</pageControl>
</subviews>
<color
key=
"backgroundColor"
white=
"0.0"
alpha=
"0.0"
colorSpace=
"custom"
customColorSpace=
"genericGamma22GrayColorSpace"
/>
...
...
@@ -136,7 +136,7 @@
<constraint
firstAttribute=
"trailing"
secondItem=
"JTs-J5-DO2"
secondAttribute=
"trailing"
constant=
"24"
id=
"Rdi-FK-2Ft"
/>
<constraint
firstAttribute=
"trailing"
secondItem=
"I7z-Fz-SNP"
secondAttribute=
"trailing"
id=
"avB-Gc-ttI"
/>
<constraint
firstItem=
"I7z-Fz-SNP"
firstAttribute=
"leading"
secondItem=
"VzF-dQ-3Wa"
secondAttribute=
"leading"
id=
"pTY-7d-s1S"
/>
<constraint
firstItem=
"I7z-Fz-SNP"
firstAttribute=
"top"
secondItem=
"JTs-J5-DO2"
secondAttribute=
"bottom"
constant=
"
5
"
id=
"vJF-jy-p83"
/>
<constraint
firstItem=
"I7z-Fz-SNP"
firstAttribute=
"top"
secondItem=
"JTs-J5-DO2"
secondAttribute=
"bottom"
constant=
"
20
"
id=
"vJF-jy-p83"
/>
<constraint
firstItem=
"lOm-CZ-dVG"
firstAttribute=
"centerX"
secondItem=
"VzF-dQ-3Wa"
secondAttribute=
"centerX"
id=
"xpw-tV-NcW"
/>
</constraints>
</view>
...
...
Please
register
or
login
to post a comment