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
2024-02-08 13:51:58 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
1d57e9fa8c4520322dd18b23434d2b310e011860
1d57e9fa
1 parent
74ef3a0f
Add OffersViewController
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
391 additions
and
71 deletions
SwiftWarplyFramework/SwiftWarplyFramework/Main.storyboard
SwiftWarplyFramework/SwiftWarplyFramework/OffersTableViewCell.swift
SwiftWarplyFramework/SwiftWarplyFramework/OffersViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
SwiftWarplyFramework/SwiftWarplyFramework/Main.storyboard
View file @
1d57e9f
...
...
@@ -4222,17 +4222,239 @@
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"414"
height=
"896"
/>
<autoresizingMask
key=
"autoresizingMask"
widthSizable=
"YES"
heightSizable=
"YES"
/>
<subviews>
<label
opaque=
"NO"
userInteractionEnabled=
"NO"
contentMode=
"left"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
fixedFrame=
"YES"
text=
"OffersViewController"
textAlignment=
"natural"
lineBreakMode=
"tailTruncation"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"gBj-Dk-4Cd"
>
<rect
key=
"frame"
x=
"124"
y=
"437"
width=
"159"
height=
"21"
/>
<autoresizingMask
key=
"autoresizingMask"
flexibleMaxX=
"YES"
flexibleMaxY=
"YES"
/>
<fontDescription
key=
"fontDescription"
type=
"system"
pointSize=
"17"
/>
<nil
key=
"textColor"
/>
<view
contentMode=
"scaleToFill"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"hUt-Dt-44M"
userLabel=
"Main View"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"414"
height=
"896"
/>
<subviews>
<tableView
clipsSubviews=
"YES"
contentMode=
"scaleToFill"
alwaysBounceVertical=
"YES"
dataMode=
"prototypes"
style=
"plain"
separatorStyle=
"none"
rowHeight=
"-1"
estimatedRowHeight=
"-1"
sectionHeaderHeight=
"-1"
estimatedSectionHeaderHeight=
"-1"
sectionFooterHeight=
"-1"
estimatedSectionFooterHeight=
"-1"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"fWD-iY-Bmd"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"414"
height=
"896"
/>
<color
key=
"backgroundColor"
white=
"0.0"
alpha=
"0.0"
colorSpace=
"custom"
customColorSpace=
"genericGamma22GrayColorSpace"
/>
<color
key=
"sectionIndexBackgroundColor"
white=
"0.0"
alpha=
"0.0"
colorSpace=
"custom"
customColorSpace=
"genericGamma22GrayColorSpace"
/>
<prototypes>
<tableViewCell
clipsSubviews=
"YES"
contentMode=
"scaleToFill"
preservesSuperviewLayoutMargins=
"YES"
selectionStyle=
"none"
indentationWidth=
"10"
reuseIdentifier=
"OffersTableViewCellId"
id=
"qj2-71-gcS"
customClass=
"OffersTableViewCell"
customModule=
"SwiftWarplyFramework"
>
<rect
key=
"frame"
x=
"0.0"
y=
"50"
width=
"414"
height=
"288"
/>
<autoresizingMask
key=
"autoresizingMask"
/>
<tableViewCellContentView
key=
"contentView"
opaque=
"NO"
clipsSubviews=
"YES"
multipleTouchEnabled=
"YES"
contentMode=
"center"
preservesSuperviewLayoutMargins=
"YES"
insetsLayoutMarginsFromSafeArea=
"NO"
tableViewCell=
"qj2-71-gcS"
id=
"kjE-xJ-Y7S"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"414"
height=
"288"
/>
<autoresizingMask
key=
"autoresizingMask"
/>
<subviews>
<view
contentMode=
"scaleToFill"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"2H8-bM-vZr"
userLabel=
"Cell View"
>
<rect
key=
"frame"
x=
"20"
y=
"0.0"
width=
"374"
height=
"288"
/>
<subviews>
<imageView
clipsSubviews=
"YES"
userInteractionEnabled=
"NO"
contentMode=
"scaleAspectFill"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"ugy-l0-Fp3"
userLabel=
"Campaign Image View"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"374"
height=
"178"
/>
<constraints>
<constraint
firstAttribute=
"height"
constant=
"178"
id=
"3xe-hD-xPM"
/>
</constraints>
</imageView>
<view
contentMode=
"scaleToFill"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"kZI-mH-ph2"
userLabel=
"Info View"
>
<rect
key=
"frame"
x=
"0.0"
y=
"178"
width=
"374"
height=
"110"
/>
<subviews>
<view
contentMode=
"scaleToFill"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"aZR-b5-0QS"
userLabel=
"Info Inner View"
>
<rect
key=
"frame"
x=
"20"
y=
"32"
width=
"334"
height=
"46"
/>
<subviews>
<label
opaque=
"NO"
userInteractionEnabled=
"NO"
contentMode=
"left"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
text=
"Label"
textAlignment=
"natural"
lineBreakMode=
"tailTruncation"
numberOfLines=
"2"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"qfZ-mQ-mRL"
userLabel=
"Title Label"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"224"
height=
"21.5"
/>
<fontDescription
key=
"fontDescription"
type=
"system"
weight=
"medium"
pointSize=
"18"
/>
<color
key=
"textColor"
red=
"0.36078431372549019"
green=
"0.36078431372549019"
blue=
"0.36078431372549019"
alpha=
"1"
colorSpace=
"calibratedRGB"
/>
<nil
key=
"highlightedColor"
/>
</label>
<label
opaque=
"NO"
userInteractionEnabled=
"NO"
contentMode=
"left"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
text=
"Label"
textAlignment=
"natural"
lineBreakMode=
"tailTruncation"
numberOfLines=
"2"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"Seo-yy-aMh"
userLabel=
"Subtitle Label"
>
<rect
key=
"frame"
x=
"0.0"
y=
"24.5"
width=
"224"
height=
"21.5"
/>
<fontDescription
key=
"fontDescription"
type=
"system"
pointSize=
"18"
/>
<color
key=
"textColor"
red=
"0.36078431372549019"
green=
"0.36078431372549019"
blue=
"0.36078431372549019"
alpha=
"1"
colorSpace=
"calibratedRGB"
/>
<nil
key=
"highlightedColor"
/>
</label>
</subviews>
<viewLayoutGuide
key=
"safeArea"
id=
"CXd-ry-9QY"
/>
<color
key=
"backgroundColor"
systemColor=
"systemBackgroundColor"
/>
<constraints>
<constraint
firstAttribute=
"bottom"
secondItem=
"Seo-yy-aMh"
secondAttribute=
"bottom"
id=
"28O-Bf-5yx"
/>
<constraint
firstItem=
"Seo-yy-aMh"
firstAttribute=
"top"
secondItem=
"qfZ-mQ-mRL"
secondAttribute=
"bottom"
constant=
"3"
id=
"3E4-m4-kYZ"
/>
<constraint
firstItem=
"qfZ-mQ-mRL"
firstAttribute=
"leading"
secondItem=
"aZR-b5-0QS"
secondAttribute=
"leading"
id=
"UT7-mm-qE8"
/>
<constraint
firstItem=
"Seo-yy-aMh"
firstAttribute=
"leading"
secondItem=
"aZR-b5-0QS"
secondAttribute=
"leading"
id=
"e4w-de-uGd"
/>
<constraint
firstItem=
"qfZ-mQ-mRL"
firstAttribute=
"top"
secondItem=
"aZR-b5-0QS"
secondAttribute=
"top"
id=
"rXT-QO-ygA"
/>
</constraints>
</view>
</subviews>
<color
key=
"backgroundColor"
white=
"1"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"genericGamma22GrayColorSpace"
/>
<constraints>
<constraint
firstAttribute=
"height"
constant=
"110"
id=
"4yV-XS-4PN"
/>
<constraint
firstAttribute=
"trailing"
secondItem=
"aZR-b5-0QS"
secondAttribute=
"trailing"
constant=
"20"
id=
"p1K-A5-Xlv"
/>
<constraint
firstItem=
"aZR-b5-0QS"
firstAttribute=
"leading"
secondItem=
"kZI-mH-ph2"
secondAttribute=
"leading"
constant=
"20"
id=
"qq7-8z-dyM"
/>
<constraint
firstItem=
"aZR-b5-0QS"
firstAttribute=
"centerY"
secondItem=
"kZI-mH-ph2"
secondAttribute=
"centerY"
id=
"swJ-jz-XdS"
/>
</constraints>
</view>
<view
contentMode=
"scaleToFill"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"yY1-NG-BaX"
userLabel=
"Discount View"
>
<rect
key=
"frame"
x=
"244"
y=
"120"
width=
"130"
height=
"130"
/>
<subviews>
<imageView
clipsSubviews=
"YES"
userInteractionEnabled=
"NO"
contentMode=
"scaleAspectFit"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"B4P-VR-pDO"
userLabel=
"Discount Image View"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"130"
height=
"130"
/>
<constraints>
<constraint
firstAttribute=
"width"
constant=
"130"
id=
"1pT-MH-uoQ"
/>
<constraint
firstAttribute=
"height"
constant=
"130"
id=
"h5Y-Yv-qc3"
/>
</constraints>
</imageView>
<view
contentMode=
"scaleToFill"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"f0e-Lz-WQc"
userLabel=
"Discount Inner View"
>
<rect
key=
"frame"
x=
"33"
y=
"34.5"
width=
"64"
height=
"61"
/>
<subviews>
<imageView
clipsSubviews=
"YES"
userInteractionEnabled=
"NO"
contentMode=
"scaleAspectFit"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"Msk-Tt-0US"
>
<rect
key=
"frame"
x=
"18"
y=
"0.0"
width=
"28"
height=
"28"
/>
<constraints>
<constraint
firstAttribute=
"width"
constant=
"28"
id=
"Plb-6p-pox"
/>
<constraint
firstAttribute=
"height"
constant=
"28"
id=
"g4M-Nh-h4e"
/>
</constraints>
</imageView>
<label
opaque=
"NO"
userInteractionEnabled=
"NO"
contentMode=
"left"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
text=
"Label"
textAlignment=
"natural"
lineBreakMode=
"tailTruncation"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"lL4-jJ-mTZ"
>
<rect
key=
"frame"
x=
"0.0"
y=
"31"
width=
"64"
height=
"30"
/>
<fontDescription
key=
"fontDescription"
type=
"boldSystem"
pointSize=
"25"
/>
<color
key=
"textColor"
white=
"1"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"genericGamma22GrayColorSpace"
/>
<nil
key=
"highlightedColor"
/>
</label>
</subviews>
<color
key=
"backgroundColor"
white=
"0.0"
alpha=
"0.0"
colorSpace=
"custom"
customColorSpace=
"genericGamma22GrayColorSpace"
/>
<constraints>
<constraint
firstItem=
"lL4-jJ-mTZ"
firstAttribute=
"leading"
secondItem=
"f0e-Lz-WQc"
secondAttribute=
"leading"
id=
"4xE-ie-F0U"
/>
<constraint
firstItem=
"Msk-Tt-0US"
firstAttribute=
"top"
secondItem=
"f0e-Lz-WQc"
secondAttribute=
"top"
id=
"GDu-Ps-8GB"
/>
<constraint
firstItem=
"Msk-Tt-0US"
firstAttribute=
"centerX"
secondItem=
"f0e-Lz-WQc"
secondAttribute=
"centerX"
id=
"Itg-2D-x2c"
/>
<constraint
firstAttribute=
"bottom"
secondItem=
"lL4-jJ-mTZ"
secondAttribute=
"bottom"
id=
"Nsw-9N-Z3M"
/>
<constraint
firstAttribute=
"trailing"
secondItem=
"lL4-jJ-mTZ"
secondAttribute=
"trailing"
id=
"Xxw-w1-4u9"
/>
<constraint
firstItem=
"lL4-jJ-mTZ"
firstAttribute=
"top"
secondItem=
"Msk-Tt-0US"
secondAttribute=
"bottom"
constant=
"3"
id=
"ftg-Mz-i7E"
/>
</constraints>
</view>
</subviews>
<color
key=
"backgroundColor"
white=
"0.0"
alpha=
"0.0"
colorSpace=
"custom"
customColorSpace=
"genericGamma22GrayColorSpace"
/>
<constraints>
<constraint
firstItem=
"f0e-Lz-WQc"
firstAttribute=
"centerX"
secondItem=
"yY1-NG-BaX"
secondAttribute=
"centerX"
id=
"GO4-hM-RK0"
/>
<constraint
firstItem=
"B4P-VR-pDO"
firstAttribute=
"leading"
secondItem=
"yY1-NG-BaX"
secondAttribute=
"leading"
id=
"Oz5-XX-Bl1"
/>
<constraint
firstItem=
"f0e-Lz-WQc"
firstAttribute=
"centerY"
secondItem=
"yY1-NG-BaX"
secondAttribute=
"centerY"
id=
"Qyg-fx-qUn"
/>
<constraint
firstAttribute=
"bottom"
secondItem=
"B4P-VR-pDO"
secondAttribute=
"bottom"
id=
"fOo-OH-cTL"
/>
<constraint
firstAttribute=
"trailing"
secondItem=
"B4P-VR-pDO"
secondAttribute=
"trailing"
id=
"fc9-Yr-nWo"
/>
<constraint
firstItem=
"B4P-VR-pDO"
firstAttribute=
"top"
secondItem=
"yY1-NG-BaX"
secondAttribute=
"top"
id=
"vr6-Nu-eDg"
/>
</constraints>
</view>
</subviews>
<color
key=
"backgroundColor"
white=
"1"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"genericGamma22GrayColorSpace"
/>
<constraints>
<constraint
firstAttribute=
"bottom"
secondItem=
"kZI-mH-ph2"
secondAttribute=
"bottom"
id=
"6Vd-QN-Sy0"
/>
<constraint
firstItem=
"ugy-l0-Fp3"
firstAttribute=
"leading"
secondItem=
"2H8-bM-vZr"
secondAttribute=
"leading"
id=
"EPW-zB-5L5"
/>
<constraint
firstItem=
"yY1-NG-BaX"
firstAttribute=
"leading"
secondItem=
"Seo-yy-aMh"
secondAttribute=
"trailing"
id=
"Eq3-Wz-PV7"
/>
<constraint
firstItem=
"ugy-l0-Fp3"
firstAttribute=
"top"
secondItem=
"2H8-bM-vZr"
secondAttribute=
"top"
id=
"GBz-dh-6OV"
/>
<constraint
firstItem=
"kZI-mH-ph2"
firstAttribute=
"leading"
secondItem=
"2H8-bM-vZr"
secondAttribute=
"leading"
id=
"Mut-DB-tiP"
/>
<constraint
firstAttribute=
"trailing"
secondItem=
"ugy-l0-Fp3"
secondAttribute=
"trailing"
id=
"UAw-w8-61R"
/>
<constraint
firstItem=
"yY1-NG-BaX"
firstAttribute=
"leading"
secondItem=
"qfZ-mQ-mRL"
secondAttribute=
"trailing"
id=
"VPy-aa-ulj"
/>
<constraint
firstAttribute=
"trailing"
secondItem=
"kZI-mH-ph2"
secondAttribute=
"trailing"
id=
"gwi-NX-Lvz"
/>
<constraint
firstItem=
"yY1-NG-BaX"
firstAttribute=
"top"
secondItem=
"kZI-mH-ph2"
secondAttribute=
"top"
constant=
"-58"
id=
"hrV-4a-Fyv"
/>
<constraint
firstItem=
"kZI-mH-ph2"
firstAttribute=
"top"
secondItem=
"ugy-l0-Fp3"
secondAttribute=
"bottom"
id=
"o7R-PR-ttI"
/>
<constraint
firstAttribute=
"trailing"
secondItem=
"yY1-NG-BaX"
secondAttribute=
"trailing"
id=
"yPX-zT-MZh"
/>
</constraints>
</view>
</subviews>
<color
key=
"backgroundColor"
white=
"0.0"
alpha=
"0.0"
colorSpace=
"custom"
customColorSpace=
"genericGamma22GrayColorSpace"
/>
<constraints>
<constraint
firstItem=
"2H8-bM-vZr"
firstAttribute=
"top"
secondItem=
"kjE-xJ-Y7S"
secondAttribute=
"top"
id=
"6gO-Pq-FAs"
/>
<constraint
firstItem=
"2H8-bM-vZr"
firstAttribute=
"leading"
secondItem=
"kjE-xJ-Y7S"
secondAttribute=
"leading"
constant=
"20"
id=
"K5t-uL-AUD"
/>
<constraint
firstAttribute=
"bottom"
secondItem=
"2H8-bM-vZr"
secondAttribute=
"bottom"
id=
"Q9G-bY-tuz"
/>
<constraint
firstAttribute=
"trailing"
secondItem=
"2H8-bM-vZr"
secondAttribute=
"trailing"
constant=
"20"
id=
"QsI-tu-Vxn"
/>
</constraints>
</tableViewCellContentView>
<color
key=
"backgroundColor"
white=
"0.0"
alpha=
"0.0"
colorSpace=
"custom"
customColorSpace=
"genericGamma22GrayColorSpace"
/>
<connections>
<outlet
property=
"campaignImage"
destination=
"ugy-l0-Fp3"
id=
"UOO-N1-bSO"
/>
<outlet
property=
"cellView"
destination=
"2H8-bM-vZr"
id=
"jBR-Ya-Oh8"
/>
<outlet
property=
"discountBGImage"
destination=
"B4P-VR-pDO"
id=
"Xzc-R2-526"
/>
<outlet
property=
"discountLabel"
destination=
"lL4-jJ-mTZ"
id=
"1nC-jg-zOy"
/>
<outlet
property=
"discountSmileImage"
destination=
"Msk-Tt-0US"
id=
"WMM-lv-l5d"
/>
<outlet
property=
"subtitleLabel"
destination=
"Seo-yy-aMh"
id=
"P7t-RE-77P"
/>
<outlet
property=
"titleLabel"
destination=
"qfZ-mQ-mRL"
id=
"1Bw-YT-TGA"
/>
</connections>
</tableViewCell>
<tableViewCell
clipsSubviews=
"YES"
contentMode=
"scaleToFill"
insetsLayoutMarginsFromSafeArea=
"NO"
selectionStyle=
"none"
hidesAccessoryWhenEditing=
"NO"
indentationLevel=
"1"
indentationWidth=
"0.0"
reuseIdentifier=
"InboxTableViewCellId"
id=
"tNJ-bm-aGv"
customClass=
"InboxTableViewCell"
customModule=
"SwiftWarplyFramework"
customModuleProvider=
"target"
>
<rect
key=
"frame"
x=
"0.0"
y=
"338"
width=
"414"
height=
"78.5"
/>
<autoresizingMask
key=
"autoresizingMask"
/>
<tableViewCellContentView
key=
"contentView"
opaque=
"NO"
clipsSubviews=
"YES"
multipleTouchEnabled=
"YES"
contentMode=
"center"
insetsLayoutMarginsFromSafeArea=
"NO"
tableViewCell=
"tNJ-bm-aGv"
id=
"A90-Li-IDd"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"414"
height=
"78.5"
/>
<autoresizingMask
key=
"autoresizingMask"
/>
<subviews>
<view
contentMode=
"scaleToFill"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"Iar-hb-ngF"
>
<rect
key=
"frame"
x=
"20"
y=
"0.0"
width=
"374"
height=
"78.5"
/>
<subviews>
<imageView
clipsSubviews=
"YES"
userInteractionEnabled=
"NO"
contentMode=
"scaleAspectFill"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"q3d-Y7-YoH"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"205.5"
height=
"78.5"
/>
</imageView>
<label
opaque=
"NO"
userInteractionEnabled=
"NO"
contentMode=
"left"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
text=
"Label"
textAlignment=
"center"
lineBreakMode=
"tailTruncation"
numberOfLines=
"0"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"dNf-ph-58z"
>
<rect
key=
"frame"
x=
"215.5"
y=
"30"
width=
"148.5"
height=
"18.5"
/>
<fontDescription
key=
"fontDescription"
name=
"PeridotPE-Regular"
family=
"Peridot PE"
pointSize=
"15"
/>
<color
key=
"textColor"
red=
"0.12941176469999999"
green=
"0.12941176469999999"
blue=
"0.12941176469999999"
alpha=
"1"
colorSpace=
"calibratedRGB"
/>
<nil
key=
"highlightedColor"
/>
</label>
</subviews>
<color
key=
"backgroundColor"
white=
"1"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"genericGamma22GrayColorSpace"
/>
<constraints>
<constraint
firstAttribute=
"bottom"
secondItem=
"q3d-Y7-YoH"
secondAttribute=
"bottom"
id=
"3lu-rv-RHI"
/>
<constraint
firstItem=
"dNf-ph-58z"
firstAttribute=
"leading"
secondItem=
"q3d-Y7-YoH"
secondAttribute=
"trailing"
constant=
"10"
id=
"BE4-GU-dWc"
/>
<constraint
firstItem=
"q3d-Y7-YoH"
firstAttribute=
"width"
secondItem=
"Iar-hb-ngF"
secondAttribute=
"width"
multiplier=
"0.55"
id=
"GNH-sm-qA8"
/>
<constraint
firstItem=
"q3d-Y7-YoH"
firstAttribute=
"top"
secondItem=
"Iar-hb-ngF"
secondAttribute=
"top"
id=
"H2X-D0-SQ0"
/>
<constraint
firstAttribute=
"bottom"
relation=
"greaterThanOrEqual"
secondItem=
"dNf-ph-58z"
secondAttribute=
"bottom"
constant=
"10"
id=
"HMr-jg-Egf"
/>
<constraint
firstItem=
"dNf-ph-58z"
firstAttribute=
"centerY"
secondItem=
"Iar-hb-ngF"
secondAttribute=
"centerY"
id=
"XRe-mw-R0J"
/>
<constraint
firstAttribute=
"trailing"
secondItem=
"dNf-ph-58z"
secondAttribute=
"trailing"
constant=
"10"
id=
"ZAx-jV-hle"
/>
<constraint
firstItem=
"q3d-Y7-YoH"
firstAttribute=
"leading"
secondItem=
"Iar-hb-ngF"
secondAttribute=
"leading"
id=
"d71-vY-Cgu"
/>
<constraint
firstItem=
"dNf-ph-58z"
firstAttribute=
"top"
relation=
"greaterThanOrEqual"
secondItem=
"Iar-hb-ngF"
secondAttribute=
"top"
constant=
"30"
id=
"oM5-Tj-eb3"
/>
</constraints>
</view>
<imageView
clipsSubviews=
"YES"
userInteractionEnabled=
"NO"
contentMode=
"scaleAspectFit"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
image=
"new_icon"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"0IZ-qO-cKj"
>
<rect
key=
"frame"
x=
"344"
y=
"5"
width=
"60"
height=
"25"
/>
<color
key=
"backgroundColor"
white=
"0.0"
alpha=
"0.0"
colorSpace=
"custom"
customColorSpace=
"genericGamma22GrayColorSpace"
/>
<constraints>
<constraint
firstAttribute=
"width"
constant=
"60"
id=
"ltd-9h-en3"
/>
<constraint
firstAttribute=
"height"
constant=
"25"
id=
"sjV-4S-ggn"
/>
</constraints>
</imageView>
</subviews>
<color
key=
"backgroundColor"
white=
"0.0"
alpha=
"0.0"
colorSpace=
"custom"
customColorSpace=
"genericGamma22GrayColorSpace"
/>
<constraints>
<constraint
firstItem=
"0IZ-qO-cKj"
firstAttribute=
"top"
secondItem=
"A90-Li-IDd"
secondAttribute=
"top"
constant=
"5"
id=
"1GR-gl-rM7"
/>
<constraint
firstAttribute=
"trailing"
secondItem=
"0IZ-qO-cKj"
secondAttribute=
"trailing"
constant=
"10"
id=
"6QW-pj-851"
/>
<constraint
firstItem=
"Iar-hb-ngF"
firstAttribute=
"leading"
secondItem=
"A90-Li-IDd"
secondAttribute=
"leading"
constant=
"20"
id=
"DbD-oU-ViN"
/>
<constraint
firstAttribute=
"trailing"
secondItem=
"Iar-hb-ngF"
secondAttribute=
"trailing"
constant=
"20"
id=
"IQM-tY-Clq"
/>
<constraint
firstAttribute=
"bottom"
secondItem=
"Iar-hb-ngF"
secondAttribute=
"bottom"
id=
"SKJ-aq-DIL"
/>
<constraint
firstItem=
"Iar-hb-ngF"
firstAttribute=
"top"
secondItem=
"A90-Li-IDd"
secondAttribute=
"top"
id=
"s7S-Fw-x5P"
/>
</constraints>
</tableViewCellContentView>
<color
key=
"backgroundColor"
white=
"0.0"
alpha=
"0.0"
colorSpace=
"custom"
customColorSpace=
"genericGamma22GrayColorSpace"
/>
<connections>
<outlet
property=
"campaignImage"
destination=
"q3d-Y7-YoH"
id=
"mSE-US-ead"
/>
<outlet
property=
"campaignTitleLabel"
destination=
"dNf-ph-58z"
id=
"OL1-vm-neo"
/>
<outlet
property=
"inboxView"
destination=
"Iar-hb-ngF"
id=
"sYI-hQ-yfh"
/>
<outlet
property=
"newBadgeImage"
destination=
"0IZ-qO-cKj"
id=
"2Vu-X1-ZX6"
/>
</connections>
</tableViewCell>
</prototypes>
<connections>
<outlet
property=
"dataSource"
destination=
"EDh-Zo-yDu"
id=
"Few-SN-h9B"
/>
<outlet
property=
"delegate"
destination=
"EDh-Zo-yDu"
id=
"3t7-6z-apW"
/>
</connections>
</tableView>
</subviews>
<color
key=
"backgroundColor"
red=
"0.90588235294117647"
green=
"0.91764705882352937"
blue=
"0.92156862745098034"
alpha=
"1"
colorSpace=
"calibratedRGB"
/>
<constraints>
<constraint
firstAttribute=
"trailing"
secondItem=
"fWD-iY-Bmd"
secondAttribute=
"trailing"
id=
"IPb-cu-IN9"
/>
<constraint
firstAttribute=
"bottom"
secondItem=
"fWD-iY-Bmd"
secondAttribute=
"bottom"
id=
"J4w-D1-Meb"
/>
<constraint
firstItem=
"fWD-iY-Bmd"
firstAttribute=
"leading"
secondItem=
"hUt-Dt-44M"
secondAttribute=
"leading"
id=
"Lrg-dN-mYl"
/>
<constraint
firstItem=
"fWD-iY-Bmd"
firstAttribute=
"top"
secondItem=
"hUt-Dt-44M"
secondAttribute=
"top"
id=
"cyE-Nr-o0W"
/>
</constraints>
</view>
</subviews>
<viewLayoutGuide
key=
"safeArea"
id=
"CXd-ry-9QY"
/>
<color
key=
"backgroundColor"
red=
"0.90588235294117647"
green=
"0.91764705882352937"
blue=
"0.92156862745098034"
alpha=
"1"
colorSpace=
"calibratedRGB"
/>
<constraints>
<constraint
firstItem=
"hUt-Dt-44M"
firstAttribute=
"leading"
secondItem=
"AgP-hz-ava"
secondAttribute=
"leading"
id=
"1mG-HG-vHv"
/>
<constraint
firstAttribute=
"trailing"
secondItem=
"hUt-Dt-44M"
secondAttribute=
"trailing"
id=
"rKd-e7-ZdE"
/>
<constraint
firstItem=
"hUt-Dt-44M"
firstAttribute=
"top"
secondItem=
"AgP-hz-ava"
secondAttribute=
"top"
id=
"rvX-7F-KDx"
/>
<constraint
firstAttribute=
"bottom"
secondItem=
"hUt-Dt-44M"
secondAttribute=
"bottom"
id=
"scN-Hh-WVC"
/>
</constraints>
</view>
<connections>
<outlet
property=
"tableView"
destination=
"fWD-iY-Bmd"
id=
"Jds-Wd-Yb6"
/>
</connections>
</viewController>
<placeholder
placeholderIdentifier=
"IBFirstResponder"
id=
"877-ji-SVH"
userLabel=
"First Responder"
customClass=
"UIResponder"
sceneMemberID=
"firstResponder"
/>
</objects>
...
...
SwiftWarplyFramework/SwiftWarplyFramework/OffersTableViewCell.swift
View file @
1d57e9f
...
...
@@ -8,10 +8,47 @@
import
UIKit
@objc
public
class
OffersTableViewCell
:
UITableViewCell
{
@IBOutlet
weak
var
cellView
:
UIView
!
@IBOutlet
weak
var
campaignImage
:
UIImageView
!
@IBOutlet
weak
var
titleLabel
:
UILabel
!
@IBOutlet
weak
var
subtitleLabel
:
UILabel
!
@IBOutlet
weak
var
discountBGImage
:
UIImageView
!
@IBOutlet
weak
var
discountSmileImage
:
UIImageView
!
@IBOutlet
weak
var
discountLabel
:
UILabel
!
var
postImageURL
:
String
?
{
didSet
{
if
let
url
=
postImageURL
{
self
.
campaignImage
.
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
.
campaignImage
.
image
=
image
}
}
}
else
{
self
.
campaignImage
.
image
=
nil
}
}
}
public
override
func
awakeFromNib
()
{
super
.
awakeFromNib
()
// Initialization code
// Add shadow
self
.
layer
.
shadowColor
=
UIColor
(
red
:
0.00
,
green
:
0.00
,
blue
:
0.00
,
alpha
:
0.16
)
.
cgColor
self
.
layer
.
shadowOffset
=
CGSize
(
width
:
0.0
,
height
:
3.0
)
self
.
layer
.
shadowOpacity
=
1.0
self
.
layer
.
shadowRadius
=
6.0
cellView
.
layer
.
cornerRadius
=
5.0
cellView
.
clipsToBounds
=
true
discountBGImage
.
image
=
UIImage
(
named
:
"offer_circle_orange"
,
in
:
MyEmptyClass
.
resourceBundle
(),
compatibleWith
:
nil
)
discountSmileImage
.
image
=
UIImage
(
named
:
"logo_smile_white_new"
,
in
:
MyEmptyClass
.
resourceBundle
(),
compatibleWith
:
nil
)
}
public
override
func
setSelected
(
_
selected
:
Bool
,
animated
:
Bool
)
{
...
...
@@ -20,4 +57,21 @@ import UIKit
// Configure the view for the selected state
}
public
override
func
layoutSubviews
()
{
super
.
layoutSubviews
()
//set the values for top,left,bottom,right margins
let
margins
=
UIEdgeInsets
(
top
:
0
,
left
:
0
,
bottom
:
20
,
right
:
0
)
contentView
.
frame
=
contentView
.
frame
.
inset
(
by
:
margins
)
}
func
configureCell
(
campaign
:
swiftApi
.
CampaignItemModel
)
{
// campaignImage.load(link: campaign.logo_url ?? "", placeholder: UIImage(), cache: URLCache())
self
.
postImageURL
=
campaign
.
logo_url
??
""
titleLabel
.
text
=
campaign
.
title
??
""
subtitleLabel
.
text
=
campaign
.
subtitle
??
""
discountLabel
.
text
=
"10%"
}
}
...
...
SwiftWarplyFramework/SwiftWarplyFramework/OffersViewController.swift
View file @
1d57e9f
...
...
@@ -8,22 +8,117 @@
import
UIKit
@objc
public
class
OffersViewController
:
UIViewController
{
@IBOutlet
weak
var
tableView
:
UITableView
!
public
var
campaigns
:
Array
<
swiftApi
.
CampaignItemModel
>
=
[]
{
didSet
{
DispatchQueue
.
main
.
async
{
self
.
tableView
.
reloadData
()
}
}
}
public
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
// Do any additional setup after loading the view.
getCampaignsRequest
()
tableView
.
delegate
=
self
tableView
.
dataSource
=
self
tableView
.
contentInset
.
top
=
25
}
/*
// MARK: - Navigation
// MARK: - Requests
func
getCampaignsRequest
()
{
swiftApi
()
.
getCampaignsAsyncNew
(
language
:
"en"
,
filters
:
[
String
:
Any
](),
getCampaignsCallback
,
failureCallback
:
{
errorCode
in
print
(
"========= getCampaignsCallback ERROR ========="
,
errorCode
)
})
}
func
getCampaignsCallback
(
_
campaignsData
:
Array
<
swiftApi
.
CampaignItemModel
>
?)
->
Void
{
if
(
campaignsData
!=
nil
)
{
DispatchQueue
.
main
.
async
{
self
.
campaigns
=
campaignsData
??
[]
self
.
tableView
.
reloadData
()
}
}
else
{
print
(
"========= getCampaignsCallback ERROR ========="
)
}
}
}
// MARK: - TableView
extension
OffersViewController
:
UITableViewDelegate
,
UITableViewDataSource
{
public
func
numberOfSections
(
in
tableView
:
UITableView
)
->
Int
{
return
1
}
public
func
tableView
(
_
tableView
:
UITableView
,
numberOfRowsInSection
section
:
Int
)
->
Int
{
return
self
.
campaigns
.
count
}
public
func
tableView
(
_
tableView
:
UITableView
,
heightForRowAt
indexPath
:
IndexPath
)
->
CGFloat
{
return
288.0
+
20.0
// return UITableViewAutomaticDimension
}
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destination.
// Pass the selected object to the new view controller.
public
func
tableView
(
_
tableView
:
UITableView
,
cellForRowAt
indexPath
:
IndexPath
)
->
UITableViewCell
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"OffersTableViewCellId"
,
for
:
indexPath
)
as!
OffersTableViewCell
cell
.
configureCell
(
campaign
:
campaigns
[
indexPath
.
row
])
return
cell
}
public
func
tableView
(
_
tableView
:
UITableView
,
didSelectRowAt
indexPath
:
IndexPath
)
{
let
status
=
swiftApi
()
.
getNetworkStatus
()
if
(
status
==
-
1
||
status
==
0
)
{
self
.
showDialog
(
"Δεν υπάρχει σύνδεση"
,
"Αυτή τη στιγμή βρίσκεσαι εκτός σύνδεσης. Παρακαλούμε βεβαιώσου ότι είσαι συνδεδεμένος στο διαδίκτυο και προσπάθησε ξανά."
)
}
else
{
let
storyboard
=
UIStoryboard
(
name
:
"Main"
,
bundle
:
Bundle
(
for
:
MyEmptyClass
.
self
))
let
vc
=
storyboard
.
instantiateViewController
(
withIdentifier
:
"CampaignViewController"
)
as!
SwiftWarplyFramework
.
CampaignViewController
var
url
=
""
var
params
=
""
// url = swiftApi().constructCampaignUrl(campaigns[indexPath.row])
// params = swiftApi().constructCampaignParams(campaigns[indexPath.row])
url
=
campaigns
[
indexPath
.
row
]
.
index_url
??
""
let
encoder
=
JSONEncoder
()
encoder
.
outputFormatting
=
.
prettyPrinted
let
data
=
try!
encoder
.
encode
(
campaigns
[
indexPath
.
row
])
print
(
"Campaign_CLICK "
+
String
(
data
:
data
,
encoding
:
.
utf8
)
!
)
print
(
"CampaignUrl url onclick: "
+
url
)
vc
.
campaignUrl
=
url
vc
.
params
=
params
self
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
}
}
func
showDialog
(
_
alertTitle
:
String
,
_
alertSubTitle
:
String
)
->
Void
{
let
alert
=
UIAlertController
(
title
:
alertTitle
,
message
:
alertSubTitle
,
preferredStyle
:
.
alert
)
alert
.
addAction
(
UIAlertAction
(
title
:
"OK"
,
style
:
.
default
,
handler
:
{
action
in
switch
action
.
style
{
case
.
default
:
print
(
"default"
)
case
.
cancel
:
print
(
"cancel"
)
case
.
destructive
:
print
(
"destructive"
)
}
}))
self
.
present
(
alert
,
animated
:
true
,
completion
:
nil
)
}
*/
}
...
...
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
View file @
1d57e9f
...
...
@@ -1456,16 +1456,10 @@ public class swiftApi {
func
campaignsCallback
(
_
campaignsData
:
[
AnyHashable
:
Any
]?)
->
Void
{
var
campaignsArray
:
Array
<
CampaignItemModel
>
=
[]
var
carouselArray
:
Array
<
CampaignItemModel
>
=
[]
if
let
responseDataDictionary
=
campaignsData
as?
[
String
:
AnyObject
]
{
if
(
responseDataDictionary
[
"MAPP_CAMPAIGNING-status"
]
as?
Int
==
1
)
{
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_success_campaigns_loyalty"
dynatraceEvent
.
_parameters
=
nil
// SwiftEventBus.post("dynatrace", sender: dynatraceEvent)
if
let
responseDataMapp
=
responseDataDictionary
[
"MAPP_CAMPAIGNING"
]
as?
[
String
:
Any
]
{
if
let
responseDataCampaigns
=
responseDataMapp
[
"campaigns"
]
as?
[[
String
:
Any
]?]
{
...
...
@@ -1475,64 +1469,24 @@ public class swiftApi {
campaignsArray
.
append
(
tempCampaign
)
}
}
}
}
else
{
getCampaignsCallback
(
nil
)
}
swiftApi
()
.
getCampaignsPersonalizedAsync
(
language
:
language
,
filters
:
filters
,
{
campaignsPersonalizedData
in
campaignsArray
=
campaignsArray
+
(
campaignsPersonalizedData
??
[])
swiftApi
()
.
setUniqueCampaignList
(
campaignsArray
)
carouselArray
=
campaignsArray
.
filter
{
let
tempCampaign
=
$0
let
isCarouselItem
=
(
tempCampaign
.
_carousel
!=
nil
)
&&
(
tempCampaign
.
_carousel
==
"true"
)
return
(
isCarouselItem
)
let
sortedCampaigns
=
campaignsArray
.
sorted
{
(
$0
.
_sorting
??
0
)
<
(
$1
.
_sorting
??
0
)
}
swiftApi
()
.
setCarouselList
(
carouselArray
)
var
filteredCampaigns
=
campaignsArray
.
filter
{
let
tempCampaign
=
$0
let
isCcmsOffer
=
(
tempCampaign
.
ccms_offer
!=
nil
)
&&
(
tempCampaign
.
ccms_offer
!=
""
)
&&
(
tempCampaign
.
ccms_offer
==
"true"
)
let
isTelco
=
(
tempCampaign
.
_type
!=
nil
&&
tempCampaign
.
_type
==
"telco"
)
return
(
!
(
isCcmsOffer
||
isTelco
)
)
getCampaignsCallback
(
sortedCampaigns
)
}
// if (swiftApi().getConsumerInternal()?._answered == true) {
filteredCampaigns
=
filteredCampaigns
.
filter
{
$0
.
offer_category
!=
"questionnaire"
}
// }
let
sortedCampaigns
=
filteredCampaigns
.
sorted
{
(
$0
.
_sorting
??
0
)
<
(
$1
.
_sorting
??
0
)
}
else
{
getCampaignsCallback
(
nil
)
}
getCampaignsCallback
(
sortedCampaigns
);
// SwiftEventBus.post("campaigns_retrieved")
},
failureCallback
:
{
errorCode
in
failureCallback
(
errorCode
)
})
}
else
{
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_error_campaigns_loyalty"
dynatraceEvent
.
_parameters
=
nil
// SwiftEventBus.post("dynatrace", sender: dynatraceEvent)
getCampaignsCallback
(
nil
)
}
}
else
{
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_error_campaigns_loyalty"
dynatraceEvent
.
_parameters
=
nil
// SwiftEventBus.post("dynatrace", sender: dynatraceEvent)
getCampaignsCallback
(
nil
)
}
}
...
...
@@ -1542,11 +1496,6 @@ public class swiftApi {
print
(
error
)
print
(
"===================="
)
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_error_campaigns_loyalty"
dynatraceEvent
.
_parameters
=
nil
// SwiftEventBus.post("dynatrace", sender: dynatraceEvent)
getCampaignsCallback
(
nil
)
}
}
...
...
Please
register
or
login
to post a comment