Manos Chorianopoulos

MyRewardsVC part2

......@@ -22,6 +22,8 @@
1EB4F42B2DE0A0AF00D934C0 /* MyRewardsOffersScrollTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1EB4F42A2DE0A0AF00D934C0 /* MyRewardsOffersScrollTableViewCell.xib */; };
1EB4F42C2DE0A0AF00D934C0 /* MyRewardsOffersScrollTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EB4F4292DE0A0AF00D934C0 /* MyRewardsOffersScrollTableViewCell.swift */; };
1EBF5F072840E13F00B8B17F /* SwiftEventBus in Frameworks */ = {isa = PBXBuildFile; productRef = 1EBF5F062840E13F00B8B17F /* SwiftEventBus */; };
1ED41E4C2DE0C24D00836ABA /* MyRewardsBannerOfferCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1ED41E4A2DE0C24D00836ABA /* MyRewardsBannerOfferCollectionViewCell.swift */; };
1ED41E4D2DE0C24D00836ABA /* MyRewardsBannerOfferCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1ED41E4B2DE0C24D00836ABA /* MyRewardsBannerOfferCollectionViewCell.xib */; };
7630AD9A6242D60846D6750C /* Pods_SwiftWarplyFramework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C0D5F56DD4E5371A50AD2D87 /* Pods_SwiftWarplyFramework.framework */; };
A07936762885E9CC00064122 /* UIColorExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = A07936752885E9CC00064122 /* UIColorExtensions.swift */; };
E6A77853282933340045BBA8 /* SwiftWarplyFramework.docc in Sources */ = {isa = PBXBuildFile; fileRef = E6A77852282933340045BBA8 /* SwiftWarplyFramework.docc */; };
......@@ -159,6 +161,8 @@
1EB4F4242DE09AAC00D934C0 /* MyRewardsBannerOffersScrollTableViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MyRewardsBannerOffersScrollTableViewCell.xib; sourceTree = "<group>"; };
1EB4F4292DE0A0AF00D934C0 /* MyRewardsOffersScrollTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyRewardsOffersScrollTableViewCell.swift; sourceTree = "<group>"; };
1EB4F42A2DE0A0AF00D934C0 /* MyRewardsOffersScrollTableViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MyRewardsOffersScrollTableViewCell.xib; sourceTree = "<group>"; };
1ED41E4A2DE0C24D00836ABA /* MyRewardsBannerOfferCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyRewardsBannerOfferCollectionViewCell.swift; sourceTree = "<group>"; };
1ED41E4B2DE0C24D00836ABA /* MyRewardsBannerOfferCollectionViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MyRewardsBannerOfferCollectionViewCell.xib; sourceTree = "<group>"; };
A07936752885E9CC00064122 /* UIColorExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIColorExtensions.swift; sourceTree = "<group>"; };
A9B7BE01A4E812DE49866EF8 /* Pods-SwiftWarplyFramework.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwiftWarplyFramework.debug.xcconfig"; path = "Target Support Files/Pods-SwiftWarplyFramework/Pods-SwiftWarplyFramework.debug.xcconfig"; sourceTree = "<group>"; };
B9EB8A451EF0C5AD75094EEE /* Pods-SwiftWarplyFramework.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwiftWarplyFramework.release.xcconfig"; path = "Target Support Files/Pods-SwiftWarplyFramework/Pods-SwiftWarplyFramework.release.xcconfig"; sourceTree = "<group>"; };
......@@ -364,6 +368,7 @@
1EA8E5BC2DDF34FB00CD3418 /* cells */ = {
isa = PBXGroup;
children = (
1ED41E492DE0C21800836ABA /* MyRewardsBannerOfferCollectionViewCell */,
1EB4F4282DE0A09500D934C0 /* MyRewardsOffersScrollTableViewCell */,
1EB4F4222DE09A4300D934C0 /* MyRewardsBannerOffersScrollTableViewCell */,
);
......@@ -388,6 +393,15 @@
path = MyRewardsOffersScrollTableViewCell;
sourceTree = "<group>";
};
1ED41E492DE0C21800836ABA /* MyRewardsBannerOfferCollectionViewCell */ = {
isa = PBXGroup;
children = (
1ED41E4A2DE0C24D00836ABA /* MyRewardsBannerOfferCollectionViewCell.swift */,
1ED41E4B2DE0C24D00836ABA /* MyRewardsBannerOfferCollectionViewCell.xib */,
);
path = MyRewardsBannerOfferCollectionViewCell;
sourceTree = "<group>";
};
98AD36FA62350CEABCD961A7 /* Frameworks */ = {
isa = PBXGroup;
children = (
......@@ -801,6 +815,7 @@
E6A778EA282933E60045BBA8 /* WLNativeVideoTableViewCell.xib in Resources */,
1E917CD62DDF64B2002221D8 /* MyRewardsViewController.xib in Resources */,
E6A7790A282933E60045BBA8 /* warp_white_close_button.png in Resources */,
1ED41E4D2DE0C24D00836ABA /* MyRewardsBannerOfferCollectionViewCell.xib in Resources */,
E6A778F4282933E60045BBA8 /* WLNativeAdCollectionViewCell.xib in Resources */,
E6A778F3282933E60045BBA8 /* WLNativeAdTableViewCell.xib in Resources */,
E6A77A38282BC3530045BBA8 /* Media.xcassets in Resources */,
......@@ -855,6 +870,7 @@
E6A778F5282933E60045BBA8 /* WLCustomNativeAdTableViewCell.m in Sources */,
E6A77901282933E60045BBA8 /* WLBaseItem.m in Sources */,
E6A778F0282933E60045BBA8 /* WLNativeAdsCollectionMode.m in Sources */,
1ED41E4C2DE0C24D00836ABA /* MyRewardsBannerOfferCollectionViewCell.swift in Sources */,
E6A7791C282933E60045BBA8 /* WLSMSActionHandlerDeprecated.m in Sources */,
E6A77934282933E70045BBA8 /* UIActivityIndicatorView+AFNetworking.m in Sources */,
E6A778E6282933E60045BBA8 /* MyEmptyClass.swift in Sources */,
......
{
"images" : [
{
"filename" : "contest_banner.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "contest_banner 1.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "contest_banner 2.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
//
// MyRewardsBannerOfferCollectionViewCell.swift
// SwiftWarplyFramework
//
// Created by Manos Chorianopoulos on 23/5/25.
//
import UIKit
@objc public class MyRewardsBannerOfferCollectionViewCell: UICollectionViewCell {
@IBOutlet weak var backgroundImage: UIImageView!
public override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
func configureCell(data: OfferModel) {
backgroundImage.image = UIImage(named: data.bannerImage, in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
}
}
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23094" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23084"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="MyRewardsBannerOfferCollectionViewCell" id="gTV-IL-0wX" customClass="MyRewardsBannerOfferCollectionViewCell" customModule="SwiftWarplyFramework" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="329" height="235"/>
<autoresizingMask key="autoresizingMask"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="0.0" y="0.0" width="329" height="235"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="UtL-2K-6j5" userLabel="Content View">
<rect key="frame" x="0.0" y="0.0" width="329" height="235"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="0vR-l5-Rgp">
<rect key="frame" x="0.0" y="0.0" width="329" height="235"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</imageView>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="0vR-l5-Rgp" firstAttribute="leading" secondItem="UtL-2K-6j5" secondAttribute="leading" id="7nR-JP-bOG"/>
<constraint firstAttribute="bottom" secondItem="0vR-l5-Rgp" secondAttribute="bottom" id="TcC-gp-xQg"/>
<constraint firstAttribute="trailing" secondItem="0vR-l5-Rgp" secondAttribute="trailing" id="ew8-fc-Alt"/>
<constraint firstItem="0vR-l5-Rgp" firstAttribute="top" secondItem="UtL-2K-6j5" secondAttribute="top" id="fKH-4h-SgQ"/>
</constraints>
</view>
</subviews>
</view>
<viewLayoutGuide key="safeArea" id="ZTg-uK-7eu"/>
<constraints>
<constraint firstItem="UtL-2K-6j5" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" id="0Dc-0s-93Y"/>
<constraint firstAttribute="bottom" secondItem="UtL-2K-6j5" secondAttribute="bottom" id="XAg-hM-jgU"/>
<constraint firstItem="UtL-2K-6j5" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" id="fVw-LI-PWH"/>
<constraint firstAttribute="trailing" secondItem="UtL-2K-6j5" secondAttribute="trailing" id="uSL-t1-ATu"/>
</constraints>
<size key="customSize" width="329" height="235"/>
<connections>
<outlet property="backgroundImage" destination="0vR-l5-Rgp" id="uTh-Ji-cdm"/>
</connections>
<point key="canvasLocation" x="68" y="-22"/>
</collectionViewCell>
</objects>
</document>
......@@ -13,8 +13,9 @@ import UIKit
@IBOutlet weak var tagView2: UIView!
@IBOutlet weak var tagLabel2: UILabel!
@IBOutlet weak var profileImage: UIImageView!
@IBOutlet weak var collectionView: UICollectionView!
var section: SectionModel?
var data: SectionModel?
public override func awakeFromNib() {
super.awakeFromNib()
......@@ -31,6 +32,10 @@ import UIKit
tagView2.layer.cornerRadius = 4.0
tagLabel2.font = UIFont(name: "PingLCG-Regular", size: 17)
tagLabel2.textColor = UIColor(rgb: 0xFFFFFF)
// Register XIBs for collection view cells
collectionView.register(UINib(nibName: "MyRewardsBannerOfferCollectionViewCell", bundle: Bundle(for: MyEmptyClass.self)), forCellWithReuseIdentifier: "MyRewardsBannerOfferCollectionViewCell")
}
public override func setSelected(_ selected: Bool, animated: Bool) {
......@@ -40,6 +45,41 @@ import UIKit
}
func configureCell(data: SectionModel?) {
self.section = data
self.data = data
}
}
extension MyRewardsBannerOffersScrollTableViewCell: UICollectionViewDataSource,UICollectionViewDelegate {
public func numberOfSections(in collectionView: UICollectionView) -> Int {
return 1
}
public func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return self.data?.offers.count ?? 0
}
public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "MyRewardsBannerOfferCollectionViewCell", for: indexPath) as! MyRewardsBannerOfferCollectionViewCell
// cell.configureCell(offer: self.data?.offers[indexPath.row])
if let offer = self.data?.offers[indexPath.row] {
cell.configureCell(data: offer)
}
return cell;
}
public func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
// TODO: open offer
}
// // Distance Between Item Cells
// func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat {
// return 5
// }
//
// // Cell Margin
// func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets {
// return UIEdgeInsets(top: 0, left: 5, bottom: 0, right: 0)
// }
}
......
......@@ -9,18 +9,18 @@
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="MyRewardsBannerOffersScrollTableViewCell" rowHeight="119" id="KGk-i7-Jjw" customClass="MyRewardsBannerOffersScrollTableViewCell" customModule="SwiftWarplyFramework" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="388" height="119"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="MyRewardsBannerOffersScrollTableViewCell" rowHeight="349" id="KGk-i7-Jjw" customClass="MyRewardsBannerOffersScrollTableViewCell" customModule="SwiftWarplyFramework" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="413" height="349"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" ambiguous="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
<rect key="frame" x="0.0" y="0.0" width="388" height="119"/>
<rect key="frame" x="0.0" y="0.0" width="413" height="349"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<view contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="VzF-dQ-3Wa" userLabel="Parent View">
<rect key="frame" x="0.0" y="0.0" width="388" height="298"/>
<rect key="frame" x="0.0" y="0.0" width="413" height="298"/>
<subviews>
<view contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="JTs-J5-DO2" userLabel="Top View">
<rect key="frame" x="24" y="36" width="340" height="43"/>
<rect key="frame" x="24" y="36" width="365" height="43"/>
<subviews>
<view contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="h09-MS-XKy">
<rect key="frame" x="0.0" y="8.6666666666666643" width="58" height="26"/>
......@@ -61,7 +61,7 @@
</constraints>
</view>
<view contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="5cf-tr-Vjf">
<rect key="frame" x="297" y="0.0" width="43" height="43"/>
<rect key="frame" x="322" y="0.0" width="43" height="43"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="fZO-NB-UyL">
<rect key="frame" x="0.0" y="0.0" width="43" height="43"/>
......@@ -93,13 +93,34 @@
<constraint firstItem="H5g-xq-68p" firstAttribute="leading" secondItem="h09-MS-XKy" secondAttribute="trailing" constant="8" id="wqx-Hc-3YH"/>
</constraints>
</view>
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" ambiguous="YES" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" dataMode="none" translatesAutoresizingMaskIntoConstraints="NO" id="I7z-Fz-SNP">
<rect key="frame" x="0.0" y="149" width="413" height="0.0"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="348" id="aEf-Xl-A2C"/>
</constraints>
<collectionViewFlowLayout key="collectionViewLayout" scrollDirection="horizontal" automaticEstimatedItemSize="YES" minimumLineSpacing="5" minimumInteritemSpacing="5" id="yIw-sc-1jC">
<size key="itemSize" width="128" height="120"/>
<size key="headerReferenceSize" width="0.0" height="0.0"/>
<size key="footerReferenceSize" width="0.0" height="0.0"/>
<inset key="sectionInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
</collectionViewFlowLayout>
<cells/>
<connections>
<outlet property="dataSource" destination="KGk-i7-Jjw" id="dZV-ST-7S4"/>
<outlet property="delegate" destination="KGk-i7-Jjw" id="fQ4-0u-38c"/>
</connections>
</collectionView>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="I7z-Fz-SNP" secondAttribute="bottom" id="0xG-dd-XJl"/>
<constraint firstItem="JTs-J5-DO2" firstAttribute="top" secondItem="VzF-dQ-3Wa" secondAttribute="top" constant="36" id="Ac5-fx-J3w"/>
<constraint firstItem="JTs-J5-DO2" firstAttribute="leading" secondItem="VzF-dQ-3Wa" secondAttribute="leading" constant="24" id="B98-id-FLf"/>
<constraint firstAttribute="trailing" secondItem="JTs-J5-DO2" secondAttribute="trailing" constant="24" id="Rdi-FK-2Ft"/>
<constraint firstAttribute="bottom" secondItem="JTs-J5-DO2" secondAttribute="bottom" constant="20" id="Ubp-Qg-xtv"/>
<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="20" id="vJF-jy-p83"/>
</constraints>
</view>
</subviews>
......@@ -113,13 +134,14 @@
<viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<connections>
<outlet property="collectionView" destination="I7z-Fz-SNP" id="yrF-mR-aQu"/>
<outlet property="profileImage" destination="fZO-NB-UyL" id="l05-qG-DJv"/>
<outlet property="tagLabel1" destination="4m7-JY-MDY" id="Min-YW-AN2"/>
<outlet property="tagLabel2" destination="WN9-wM-hV8" id="yWk-1S-4Zk"/>
<outlet property="tagView1" destination="h09-MS-XKy" id="Hxa-cN-6i4"/>
<outlet property="tagView2" destination="H5g-xq-68p" id="Vcv-Si-g68"/>
</connections>
<point key="canvasLocation" x="53.435114503816791" y="14.43661971830986"/>
<point key="canvasLocation" x="72.51908396946564" y="95.422535211267615"/>
</tableViewCell>
</objects>
</document>
......