Manos Chorianopoulos

add MyRewardsProfileInfoTableViewCell

......@@ -48,6 +48,8 @@ let package = Package(
.process("screens/MyRewardsViewController/MyRewardsViewController.xib"),
.process("cells/MyRewardsBannerOfferCollectionViewCell/MyRewardsBannerOfferCollectionViewCell.xib"),
.process("cells/MyRewardsOffersScrollTableViewCell/MyRewardsOffersScrollTableViewCell.xib"),
.process("cells/MyRewardsProfileInfoTableViewCell/MyRewardsProfileInfoTableViewCell.xib"),
.process("cells/MyRewardsFiltersTableViewCell/MyRewardsFiltersTableViewCell.xib"),
.process("cells/ProfileCouponTableViewCell/ProfileCouponTableViewCell.xib"),
.process("cells/ProfileFilterCollectionViewCell/ProfileFilterCollectionViewCell.xib"),
.process("screens/CouponViewController/CouponViewController.xib"),
......
......@@ -7,7 +7,7 @@
<key>Pods-SwiftWarplyFramework.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
<integer>0</integer>
</dict>
</dict>
</dict>
......
......@@ -73,6 +73,8 @@
1EDD0AC62E0D68B6005E162B /* SQLite in Frameworks */ = {isa = PBXBuildFile; productRef = 1EDD0AC52E0D68B6005E162B /* SQLite */; };
622DA0AE2F51CAEE00308AB8 /* CouponsetViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 622DA0AD2F51CAEE00308AB8 /* CouponsetViewController.xib */; };
622DA0AF2F51CAEE00308AB8 /* CouponsetViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 622DA0AC2F51CAEE00308AB8 /* CouponsetViewController.swift */; };
6250ABCA2F6D5ABE002A5A8D /* MyRewardsFiltersTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6250ABC92F6D5ABE002A5A8D /* MyRewardsFiltersTableViewCell.xib */; };
6250ABCB2F6D5ABE002A5A8D /* MyRewardsFiltersTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6250ABC82F6D5ABE002A5A8D /* MyRewardsFiltersTableViewCell.swift */; };
626AF6DB2F698FF1008BCA08 /* MerchantAnnotation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 626AF6DA2F698FF1008BCA08 /* MerchantAnnotation.swift */; };
626AF6DE2F699081008BCA08 /* MapViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 626AF6DC2F699081008BCA08 /* MapViewController.swift */; };
626AF6DF2F699081008BCA08 /* MapViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 626AF6DD2F699081008BCA08 /* MapViewController.xib */; };
......@@ -166,6 +168,8 @@
1EDD0ABC2E0D308A005E162B /* XIBLoader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XIBLoader.swift; sourceTree = "<group>"; };
622DA0AC2F51CAEE00308AB8 /* CouponsetViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CouponsetViewController.swift; sourceTree = "<group>"; };
622DA0AD2F51CAEE00308AB8 /* CouponsetViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CouponsetViewController.xib; sourceTree = "<group>"; };
6250ABC82F6D5ABE002A5A8D /* MyRewardsFiltersTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyRewardsFiltersTableViewCell.swift; sourceTree = "<group>"; };
6250ABC92F6D5ABE002A5A8D /* MyRewardsFiltersTableViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MyRewardsFiltersTableViewCell.xib; sourceTree = "<group>"; };
626AF6DA2F698FF1008BCA08 /* MerchantAnnotation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MerchantAnnotation.swift; sourceTree = "<group>"; };
626AF6DC2F699081008BCA08 /* MapViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapViewController.swift; sourceTree = "<group>"; };
626AF6DD2F699081008BCA08 /* MapViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MapViewController.xib; sourceTree = "<group>"; };
......@@ -385,6 +389,7 @@
1EB4F4282DE0A09500D934C0 /* MyRewardsOffersScrollTableViewCell */,
1EB4F4222DE09A4300D934C0 /* MyRewardsBannerOffersScrollTableViewCell */,
1E66E4942E30F8C600BCEF9D /* MyRewardsProfileInfoTableViewCell */,
6250ABC72F6D5A87002A5A8D /* MyRewardsFiltersTableViewCell */,
);
path = cells;
sourceTree = "<group>";
......@@ -479,6 +484,15 @@
path = CouponsetViewController;
sourceTree = "<group>";
};
6250ABC72F6D5A87002A5A8D /* MyRewardsFiltersTableViewCell */ = {
isa = PBXGroup;
children = (
6250ABC82F6D5ABE002A5A8D /* MyRewardsFiltersTableViewCell.swift */,
6250ABC92F6D5ABE002A5A8D /* MyRewardsFiltersTableViewCell.xib */,
);
path = MyRewardsFiltersTableViewCell;
sourceTree = "<group>";
};
626AF6D92F698F96008BCA08 /* MapViewController */ = {
isa = PBXGroup;
children = (
......@@ -713,6 +727,7 @@
1EDBAF042DE843CA00911E79 /* ProfileCouponTableViewCell.xib in Resources */,
627B9C762F6C3EB000A2456F /* CategoryOffersViewController.xib in Resources */,
1EDBAF0C2DE8441000911E79 /* ProfileQuestionnaireTableViewCell.xib in Resources */,
6250ABCA2F6D5ABE002A5A8D /* MyRewardsFiltersTableViewCell.xib in Resources */,
E6A77A38282BC3530045BBA8 /* Media.xcassets in Resources */,
627B9C852F6C492F00A2456F /* CategoryOffersGridTableViewCell.xib in Resources */,
1E116F682DE845B1009AE791 /* ProfileFilterCollectionViewCell.xib in Resources */,
......@@ -819,6 +834,7 @@
1E917CD72DDF64B2002221D8 /* MyRewardsViewController.swift in Sources */,
1E917CDC2DDF68C7002221D8 /* CouponViewController.swift in Sources */,
1E4C4CFB2DE6014500279AAD /* CopyableLabel.swift in Sources */,
6250ABCB2F6D5ABE002A5A8D /* MyRewardsFiltersTableViewCell.swift in Sources */,
626AF6DE2F699081008BCA08 /* MapViewController.swift in Sources */,
1EDBAF112DE8443B00911E79 /* ProfileHeaderTableViewCell.swift in Sources */,
1EDBAF052DE843CA00911E79 /* ProfileCouponTableViewCell.swift in Sources */,
......
......@@ -7,7 +7,7 @@
<key>SwiftWarplyFramework.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
<integer>1</integer>
</dict>
</dict>
</dict>
......
//
// MyRewardsFiltersTableViewCell.swift
// SwiftWarplyFramework
//
// Created by Manos Chorianopoulos on 20/3/26.
//
import UIKit
@objc(MyRewardsFiltersTableViewCell)
public class MyRewardsFiltersTableViewCell: UITableViewCell {
@IBOutlet weak var filtersView: UIView!
@IBOutlet weak var filtersLabel: UILabel!
@IBOutlet weak var filtersImage: UIImageView!
@IBOutlet weak var mapView: UIView!
@IBOutlet weak var mapImage: UIImageView!
@IBOutlet weak var filtersButton: UIButton!
@IBOutlet weak var mapButton: UIButton!
public override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
self.filtersView.backgroundColor = UIColor(rgb: 0xF1F2F4)
self.filtersView.layer.cornerRadius = 16 // Assuming height is 32 or similar based on standard chip design
self.filtersView.layer.masksToBounds = true
self.filtersLabel.text = "Αναζήτηση"
self.filtersLabel.font = UIFont(name: "PingLCG-Regular", size: 16)
self.filtersLabel.textColor = UIColor(rgb: 0x000F1E)
self.filtersLabel.frame.size.width = self.filtersLabel.intrinsicContentSize.width
self.filtersLabel.frame.size.height = self.filtersLabel.intrinsicContentSize.height
self.filtersImage.image = UIImage(named: "filter", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
if mapView != nil {
self.mapView.backgroundColor = UIColor(rgb: 0xF1F2F4)
self.mapView.layer.cornerRadius = 22 // Assuming height is 44
self.mapView.layer.masksToBounds = true
}
if mapImage != nil {
self.mapImage.image = UIImage(named: "map_pin_2", in: Bundle.frameworkResourceBundle, compatibleWith: nil)
}
}
public override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
}
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="24506" 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="24504"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.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"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="MyRewardsFiltersTableViewCell" rowHeight="76" id="KGk-i7-Jjw" customClass="MyRewardsFiltersTableViewCell" customModule="SwiftWarplyFramework" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="320" height="76"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" ambiguous="YES" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
<rect key="frame" x="0.0" y="0.0" width="320" height="76"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<view contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="bkB-JL-Vfn" userLabel="HeaderView">
<rect key="frame" x="0.0" y="24" width="320" height="20"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="sSt-4C-oHy" userLabel="FiltersView">
<rect key="frame" x="18" y="0.0" width="129.66666666666666" height="32"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Αναζήτηση" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="cy5-nB-X7u" userLabel="FiltersLabel">
<rect key="frame" x="12" y="5.9999999999999982" width="83.666666666666671" height="20.333333333333329"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="n7X-Qx-pQ1" userLabel="Filters Image View">
<rect key="frame" x="101.66666666666667" y="8" width="16" height="16"/>
<constraints>
<constraint firstAttribute="width" constant="16" id="Eqg-CG-Tt7"/>
<constraint firstAttribute="height" constant="16" id="cto-Dy-k09"/>
</constraints>
</imageView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="iYB-2q-8dL">
<rect key="frame" x="0.0" y="0.0" width="129.66666666666666" height="32"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="plain" title="Button">
<color key="baseForegroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</buttonConfiguration>
</button>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="n7X-Qx-pQ1" firstAttribute="centerY" secondItem="sSt-4C-oHy" secondAttribute="centerY" id="100-YI-bgI"/>
<constraint firstItem="cy5-nB-X7u" firstAttribute="centerY" secondItem="sSt-4C-oHy" secondAttribute="centerY" id="AS5-GP-KUr"/>
<constraint firstItem="cy5-nB-X7u" firstAttribute="leading" secondItem="sSt-4C-oHy" secondAttribute="leading" constant="12" id="BgH-Js-i7j"/>
<constraint firstAttribute="bottom" secondItem="iYB-2q-8dL" secondAttribute="bottom" id="OXt-Ak-CsU"/>
<constraint firstItem="n7X-Qx-pQ1" firstAttribute="leading" secondItem="cy5-nB-X7u" secondAttribute="trailing" constant="6" id="P41-Tz-OAo"/>
<constraint firstItem="iYB-2q-8dL" firstAttribute="leading" secondItem="sSt-4C-oHy" secondAttribute="leading" id="def-UO-nPQ"/>
<constraint firstAttribute="trailing" secondItem="n7X-Qx-pQ1" secondAttribute="trailing" constant="12" id="ov2-MB-hrs"/>
<constraint firstAttribute="trailing" secondItem="iYB-2q-8dL" secondAttribute="trailing" id="p1Z-1g-wOG"/>
<constraint firstItem="iYB-2q-8dL" firstAttribute="top" secondItem="sSt-4C-oHy" secondAttribute="top" id="tCL-WX-InD"/>
<constraint firstAttribute="height" constant="32" id="zxY-Tw-usz"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="GHE-KI-9tg" userLabel="MapView">
<rect key="frame" x="258" y="-6" width="44" height="44"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="k8m-BH-IxE" userLabel="Map Image View">
<rect key="frame" x="12" y="12" width="20" height="20"/>
<constraints>
<constraint firstAttribute="height" constant="20" id="8Ll-gy-xXg"/>
<constraint firstAttribute="width" constant="20" id="pBH-V0-8Nj"/>
</constraints>
</imageView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="d01-Y6-q6l">
<rect key="frame" x="0.0" y="0.0" width="44" height="44"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="plain" title="Button">
<color key="baseForegroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</buttonConfiguration>
</button>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstAttribute="height" constant="44" id="DfQ-IE-c67"/>
<constraint firstItem="k8m-BH-IxE" firstAttribute="centerX" secondItem="GHE-KI-9tg" secondAttribute="centerX" id="OoU-eV-Xkh"/>
<constraint firstItem="k8m-BH-IxE" firstAttribute="centerY" secondItem="GHE-KI-9tg" secondAttribute="centerY" id="cZl-K3-dkT"/>
<constraint firstAttribute="width" constant="44" id="nd0-tE-vKC"/>
<constraint firstItem="d01-Y6-q6l" firstAttribute="top" secondItem="GHE-KI-9tg" secondAttribute="top" id="PBu-Uu-MDq"/>
<constraint firstItem="d01-Y6-q6l" firstAttribute="leading" secondItem="GHE-KI-9tg" secondAttribute="leading" id="4Pk-OT-LQ6"/>
<constraint firstAttribute="trailing" secondItem="d01-Y6-q6l" secondAttribute="trailing" id="WzZ-r0-HTj"/>
<constraint firstAttribute="bottom" secondItem="d01-Y6-q6l" secondAttribute="bottom" id="eg0-Pp-vCp"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="sSt-4C-oHy" firstAttribute="leading" secondItem="bkB-JL-Vfn" secondAttribute="leading" constant="18" id="5pn-cY-zMp"/>
<constraint firstAttribute="bottom" secondItem="sSt-4C-oHy" secondAttribute="bottom" id="Bf7-Ee-EMt"/>
<constraint firstItem="GHE-KI-9tg" firstAttribute="centerY" secondItem="sSt-4C-oHy" secondAttribute="centerY" id="HYW-Bp-COU"/>
<constraint firstAttribute="trailing" secondItem="GHE-KI-9tg" secondAttribute="trailing" constant="18" id="N5l-ZF-3tU"/>
<constraint firstItem="sSt-4C-oHy" firstAttribute="top" secondItem="bkB-JL-Vfn" secondAttribute="top" id="XRz-p7-DUf"/>
</constraints>
</view>
</subviews>
<constraints>
<constraint firstAttribute="trailing" secondItem="bkB-JL-Vfn" secondAttribute="trailing" id="NTG-gR-Wn8"/>
<constraint firstItem="bkB-JL-Vfn" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="24" id="aC7-GL-OJD"/>
<constraint firstItem="bkB-JL-Vfn" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="stg-Zc-wZx"/>
<constraint firstAttribute="bottom" secondItem="bkB-JL-Vfn" secondAttribute="bottom" id="zSm-aE-Ffd"/>
</constraints>
</tableViewCellContentView>
<viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
<connections>
<outlet property="filtersButton" destination="iYB-2q-8dL" id="IfO-nm-nWT"/>
<outlet property="filtersImage" destination="n7X-Qx-pQ1" id="2mC-0a-hA0"/>
<outlet property="filtersLabel" destination="cy5-nB-X7u" id="j2y-1m-geZ"/>
<outlet property="filtersView" destination="sSt-4C-oHy" id="CVg-Fk-E2G"/>
<outlet property="mapButton" destination="d01-Y6-q6l" id="gly-Le-7ea"/>
<outlet property="mapImage" destination="k8m-BH-IxE" id="a8X-08-dmo"/>
<outlet property="mapView" destination="GHE-KI-9tg" id="njW-P9-8Yw"/>
</connections>
<point key="canvasLocation" x="65.648854961832058" y="164.78873239436621"/>
</tableViewCell>
</objects>
<resources>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>
......@@ -12,6 +12,7 @@ import Foundation
public enum SectionType {
case myRewardsProfileInfo // MyRewardsProfileInfoTableViewCell
case myRewardsFilters // MyRewardsFiltersTableViewCell
case myRewardsBannerOffers // MyRewardsBannerOffersScrollTableViewCell
case myRewardsHorizontalCouponsets // MyRewardsOffersScrollTableViewCell
case profileHeader // ProfileHeaderTableViewCell (no items)
......
......@@ -135,6 +135,7 @@ import UIKit
private func registerTableViewCells() {
let cellConfigs = [
("MyRewardsProfileInfoTableViewCell", "MyRewardsProfileInfoTableViewCell"),
("MyRewardsFiltersTableViewCell", "MyRewardsFiltersTableViewCell"),
("MyRewardsBannerOffersScrollTableViewCell", "MyRewardsBannerOffersScrollTableViewCell"),
("MyRewardsOffersScrollTableViewCell", "MyRewardsOffersScrollTableViewCell")
]
......@@ -573,6 +574,10 @@ import UIKit
// Always insert at index 0 (top of the list)
sections.insert(defaultProfileSection, at: 0)
profileSection = defaultProfileSection
// Insert filters cell immediately below profile info
let filtersSection = SectionModel(sectionType: .myRewardsFilters)
sections.insert(filtersSection, at: 1)
}
private func updateProfileSectionWithData(_ profile: ProfileModel) {
......@@ -734,6 +739,12 @@ extension MyRewardsViewController: UITableViewDelegate, UITableViewDataSource{
cell.configureCell(data: sectionModel)
return cell
case .myRewardsFilters:
let cell = tableView.dequeueReusableCell(withIdentifier: "MyRewardsFiltersTableViewCell", for: indexPath) as! MyRewardsFiltersTableViewCell
// TODO: wire filtersButton action (e.g. open filter sheet)
// TODO: wire mapButton action (e.g. open map view)
return cell
case .myRewardsBannerOffers:
let cell = tableView.dequeueReusableCell(withIdentifier: "MyRewardsBannerOffersScrollTableViewCell", for: indexPath) as! MyRewardsBannerOffersScrollTableViewCell
cell.delegate = self
......