Manos Chorianopoulos

myCoupons fixes

...@@ -56,6 +56,8 @@ let package = Package( ...@@ -56,6 +56,8 @@ let package = Package(
56 .process("screens/CampaignViewController/CampaignViewController.xib"), 56 .process("screens/CampaignViewController/CampaignViewController.xib"),
57 .process("cells/MyRewardsOfferCollectionViewCell/MyRewardsOfferCollectionViewCell.xib"), 57 .process("cells/MyRewardsOfferCollectionViewCell/MyRewardsOfferCollectionViewCell.xib"),
58 .process("cells/MyRewardsBannerOffersScrollTableViewCell/MyRewardsBannerOffersScrollTableViewCell.xib") 58 .process("cells/MyRewardsBannerOffersScrollTableViewCell/MyRewardsBannerOffersScrollTableViewCell.xib")
59 + .process("cells/MyCouponsViewController/MyCouponsViewController.xib")
60 + .process("cells/MyCouponsHeaderTableViewCell/MyCouponsHeaderTableViewCell.xib")
59 ] 61 ]
60 ), 62 ),
61 ] 63 ]
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
7 <key>Pods-SwiftWarplyFramework.xcscheme_^#shared#^_</key> 7 <key>Pods-SwiftWarplyFramework.xcscheme_^#shared#^_</key>
8 <dict> 8 <dict>
9 <key>orderHint</key> 9 <key>orderHint</key>
10 - <integer>1</integer> 10 + <integer>0</integer>
11 </dict> 11 </dict>
12 </dict> 12 </dict>
13 </dict> 13 </dict>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
7 <key>SwiftWarplyFramework.xcscheme_^#shared#^_</key> 7 <key>SwiftWarplyFramework.xcscheme_^#shared#^_</key>
8 <dict> 8 <dict>
9 <key>orderHint</key> 9 <key>orderHint</key>
10 - <integer>0</integer> 10 + <integer>1</integer>
11 </dict> 11 </dict>
12 </dict> 12 </dict>
13 </dict> 13 </dict>
......
...@@ -36,55 +36,96 @@ extension UIViewController { ...@@ -36,55 +36,96 @@ extension UIViewController {
36 ]) 36 ])
37 } 37 }
38 38
39 - func setBackButton(_ icon:String = "ic_back_3") { 39 +// func setBackButton(_ icon:String = "ic_back_3") {
40 -// let uiscreen: CGRect = UIScreen.main.bounds 40 +// // let uiscreen: CGRect = UIScreen.main.bounds
41 - 41 +
42 -// let backButton = UIButton(type: UIButton.ButtonType.custom) as UIButton 42 +// // let backButton = UIButton(type: UIButton.ButtonType.custom) as UIButton
43 -// if (icon == "ic_close_2") { 43 +// // if (icon == "ic_close_2") {
44 -// backButton.frame = CGRect(x: 0, y: 0, width: 18, height: 18) 44 +// // backButton.frame = CGRect(x: 0, y: 0, width: 18, height: 18)
45 -// } else { 45 +// // } else {
46 -// backButton.frame = CGRect(x: 0, y: 0, width: 18, height: 18) 46 +// // backButton.frame = CGRect(x: 0, y: 0, width: 18, height: 18)
47 +// // }
48 +// // // backButton.frame = CGRect(x: 0, y: 0, width: uiscreen.height * 0.01, height: uiscreen.height * 0.01)
49 +// // // backButton.backgroundColor = .red
50 +// // backButton.imageView!.contentMode = .scaleAspectFit
51 +// // //backButton.setBackgroundImage(UIImage(named:Assets.Navigation.backButton), for: UIControlState())
52 +// // // backButton.setImage(UIImage(named: icon), for: .normal)
53 +// // backButton.setBackgroundImage(UIImage(named: icon), for: .normal)
54 +// // // backButton.imageEdgeInsets = UIEdgeInsets(top: 0, left: -20, bottom: 0, right: 0)
55 +// // backButton.addTarget(self, action: #selector(moveToBack(_:)), for: .touchUpInside)
56 +
57 +
58 +// // backButton.translatesAutoresizingMaskIntoConstraints = false
59 +// // // Add width, height constraints
60 +// // if (icon == "ic_close_2") {
61 +// // let widthContraints = NSLayoutConstraint(item: backButton, attribute: NSLayoutConstraint.Attribute.width, relatedBy: NSLayoutConstraint.Relation.equal, toItem: nil, attribute: NSLayoutConstraint.Attribute.notAnAttribute, multiplier: 1, constant: 18)
62 +// // let heightContraints = NSLayoutConstraint(item: backButton, attribute: NSLayoutConstraint.Attribute.height, relatedBy: NSLayoutConstraint.Relation.equal, toItem: nil, attribute: NSLayoutConstraint.Attribute.notAnAttribute, multiplier: 1, constant: 18)
63 +// // NSLayoutConstraint.activate([heightContraints,widthContraints])
64 +// // } else {
65 +// // let widthContraints = NSLayoutConstraint(item: backButton, attribute: NSLayoutConstraint.Attribute.width, relatedBy: NSLayoutConstraint.Relation.equal, toItem: nil, attribute: NSLayoutConstraint.Attribute.notAnAttribute, multiplier: 1, constant: 18)
66 +// // let heightContraints = NSLayoutConstraint(item: backButton, attribute: NSLayoutConstraint.Attribute.height, relatedBy: NSLayoutConstraint.Relation.equal, toItem: nil, attribute: NSLayoutConstraint.Attribute.notAnAttribute, multiplier: 1, constant: 18)
67 +// // NSLayoutConstraint.activate([heightContraints,widthContraints])
68 +// // }
69 +
70 +// // let leftBarButtonItem: UIBarButtonItem = UIBarButtonItem(customView: backButton)
71 +// // NSLayoutConstraint.activate([(leftBarButtonItem.customView!.widthAnchor.constraint(equalToConstant: 18)),(leftBarButtonItem.customView!.heightAnchor.constraint(equalToConstant: 18))])
72 +// // self.navigationItem.setLeftBarButton(leftBarButtonItem, animated: false)
73 +
74 +
75 +// self.navigationItem.setHidesBackButton(true, animated:false)
76 +
77 +// //your custom view for back image with custom size
78 +// let view = UIView(frame: CGRect(x: 0, y: 0, width: 40, height: 40))
79 +// let imageView = UIImageView(frame: CGRect(x: 10, y: 12, width: 15, height: 15))
80 +
81 +// if let imgBackArrow = UIImage(named: icon, in: Bundle.frameworkResourceBundle, compatibleWith: nil) {
82 +// imageView.image = imgBackArrow
47 // } 83 // }
48 -// // backButton.frame = CGRect(x: 0, y: 0, width: uiscreen.height * 0.01, height: uiscreen.height * 0.01) 84 +// view.addSubview(imageView)
49 -// // backButton.backgroundColor = .red 85 +
50 -// backButton.imageView!.contentMode = .scaleAspectFit 86 +// let backTap = UITapGestureRecognizer(target: self, action: #selector(moveToBack(_:)))
51 -// //backButton.setBackgroundImage(UIImage(named:Assets.Navigation.backButton), for: UIControlState()) 87 +// view.addGestureRecognizer(backTap)
52 -// // backButton.setImage(UIImage(named: icon), for: .normal) 88 +
53 -// backButton.setBackgroundImage(UIImage(named: icon), for: .normal) 89 +// let leftBarButtonItem = UIBarButtonItem(customView: view )
54 -// // backButton.imageEdgeInsets = UIEdgeInsets(top: 0, left: -20, bottom: 0, right: 0) 90 +// self.navigationItem.leftBarButtonItem = leftBarButtonItem
55 -// backButton.addTarget(self, action: #selector(moveToBack(_:)), for: .touchUpInside) 91 +
56 - 92 +// self.navigationItem.title = ""
57 - 93 +
58 -// backButton.translatesAutoresizingMaskIntoConstraints = false 94 +// // Add backgroundColor
59 -// // Add width, height constraints 95 +// if #available(iOS 15, *) {
60 -// if (icon == "ic_close_2") { 96 +// let navigationBarAppearance = UINavigationBarAppearance()
61 -// let widthContraints = NSLayoutConstraint(item: backButton, attribute: NSLayoutConstraint.Attribute.width, relatedBy: NSLayoutConstraint.Relation.equal, toItem: nil, attribute: NSLayoutConstraint.Attribute.notAnAttribute, multiplier: 1, constant: 18) 97 +// navigationBarAppearance.configureWithDefaultBackground()
62 -// let heightContraints = NSLayoutConstraint(item: backButton, attribute: NSLayoutConstraint.Attribute.height, relatedBy: NSLayoutConstraint.Relation.equal, toItem: nil, attribute: NSLayoutConstraint.Attribute.notAnAttribute, multiplier: 1, constant: 18) 98 +// navigationBarAppearance.backgroundColor = .white
63 -// NSLayoutConstraint.activate([heightContraints,widthContraints]) 99 +
100 +// navigationItem.standardAppearance = navigationBarAppearance
101 +// navigationItem.compactAppearance = navigationBarAppearance
102 +// navigationItem.scrollEdgeAppearance = navigationBarAppearance
64 // } else { 103 // } else {
65 -// let widthContraints = NSLayoutConstraint(item: backButton, attribute: NSLayoutConstraint.Attribute.width, relatedBy: NSLayoutConstraint.Relation.equal, toItem: nil, attribute: NSLayoutConstraint.Attribute.notAnAttribute, multiplier: 1, constant: 18) 104 +// navigationController?.navigationBar.barTintColor = UIColor.white
66 -// let heightContraints = NSLayoutConstraint(item: backButton, attribute: NSLayoutConstraint.Attribute.height, relatedBy: NSLayoutConstraint.Relation.equal, toItem: nil, attribute: NSLayoutConstraint.Attribute.notAnAttribute, multiplier: 1, constant: 18) 105 +// navigationController?.navigationBar.tintColor = UIColor.white
67 -// NSLayoutConstraint.activate([heightContraints,widthContraints]) 106 +// // navigationController?.navigationBar.isTranslucent = false
68 // } 107 // }
69 108
70 -// let leftBarButtonItem: UIBarButtonItem = UIBarButtonItem(customView: backButton) 109 +// // Remove navigationBar bottom border
71 -// NSLayoutConstraint.activate([(leftBarButtonItem.customView!.widthAnchor.constraint(equalToConstant: 18)),(leftBarButtonItem.customView!.heightAnchor.constraint(equalToConstant: 18))]) 110 +// // self.navigationController?.navigationBar.hideBottomHairline()
72 -// self.navigationItem.setLeftBarButton(leftBarButtonItem, animated: false) 111 +// self.navigationController?.hideHairline()
73 112
113 +// self.navigationController?.navigationBar.setBackgroundImage(UIImage(), for:.default)
114 +// self.navigationController?.navigationBar.shadowImage = UIImage()
115 +// self.navigationController?.navigationBar.layoutIfNeeded()
116 +// }
74 117
75 - self.navigationItem.setHidesBackButton(true, animated:false) 118 + func setBackButton(_ icon:String = "ic_back_4") {
119 + self.navigationItem.setHidesBackButton(true, animated: false)
76 120
77 - //your custom view for back image with custom size 121 + let button = UIButton(type: .custom)
78 - let view = UIView(frame: CGRect(x: 0, y: 0, width: 40, height: 40)) 122 + button.frame = CGRect(x: 0, y: 0, width: 24, height: 24)
79 - let imageView = UIImageView(frame: CGRect(x: 10, y: 12, width: 15, height: 15)) 123 + button.imageView?.contentMode = .scaleAspectFit
80 124
81 - if let imgBackArrow = UIImage(named: icon, in: Bundle.frameworkResourceBundle, compatibleWith: nil) { 125 + if let img = UIImage(named: icon, in: Bundle.frameworkResourceBundle, compatibleWith: nil) {
82 - imageView.image = imgBackArrow 126 + button.setImage(img, for: .normal)
83 } 127 }
84 - view.addSubview(imageView) 128 + button.addTarget(self, action: #selector(moveToBack(_:)), for: .touchUpInside)
85 -
86 - let backTap = UITapGestureRecognizer(target: self, action: #selector(moveToBack(_:)))
87 - view.addGestureRecognizer(backTap)
88 129
89 let leftBarButtonItem = UIBarButtonItem(customView: view ) 130 let leftBarButtonItem = UIBarButtonItem(customView: view )
90 self.navigationItem.leftBarButtonItem = leftBarButtonItem 131 self.navigationItem.leftBarButtonItem = leftBarButtonItem
......
...@@ -10,25 +10,25 @@ ...@@ -10,25 +10,25 @@
10 <objects> 10 <objects>
11 <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/> 11 <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
12 <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> 12 <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
13 - <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="KGk-i7-Jjw" customClass="MyCouponsHeaderTableViewCell" customModule="SwiftWarplyFramework" customModuleProvider="target"> 13 + <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="MyCouponsHeaderTableViewCell" id="KGk-i7-Jjw" customClass="MyCouponsHeaderTableViewCell" customModule="SwiftWarplyFramework" customModuleProvider="target">
14 <rect key="frame" x="0.0" y="0.0" width="320" height="44"/> 14 <rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
15 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> 15 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
16 - <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM"> 16 + <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" ambiguous="YES" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
17 <rect key="frame" x="0.0" y="0.0" width="320" height="44"/> 17 <rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
18 <autoresizingMask key="autoresizingMask"/> 18 <autoresizingMask key="autoresizingMask"/>
19 <subviews> 19 <subviews>
20 - <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="9zr-3O-Ndy" userLabel="ParentView"> 20 + <view contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="9zr-3O-Ndy" userLabel="ParentView">
21 <rect key="frame" x="0.0" y="0.0" width="320" height="30"/> 21 <rect key="frame" x="0.0" y="0.0" width="320" height="30"/>
22 <subviews> 22 <subviews>
23 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="My Coupons" textAlignment="natural" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="QuH-xv-rPx" userLabel="TitleLabel"> 23 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="My Coupons" textAlignment="natural" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="QuH-xv-rPx" userLabel="TitleLabel">
24 - <rect key="frame" x="18" y="-0.66666666666666607" width="156.33333333333334" height="31.333333333333329"/> 24 + <rect key="frame" x="18" y="8.6666666666666643" width="156.33333333333334" height="31"/>
25 <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> 25 <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
26 <fontDescription key="fontDescription" name="HelveticaNeue-Bold" family="Helvetica Neue" pointSize="26"/> 26 <fontDescription key="fontDescription" name="HelveticaNeue-Bold" family="Helvetica Neue" pointSize="26"/>
27 <color key="textColor" red="0.067000000000000004" green="0.067000000000000004" blue="0.067000000000000004" alpha="1" colorSpace="calibratedRGB"/> 27 <color key="textColor" red="0.067000000000000004" green="0.067000000000000004" blue="0.067000000000000004" alpha="1" colorSpace="calibratedRGB"/>
28 <nil key="highlightedColor"/> 28 <nil key="highlightedColor"/>
29 </label> 29 </label>
30 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="NOc-fo-goN" userLabel="SearchButton"> 30 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="NOc-fo-goN" userLabel="SearchButton">
31 - <rect key="frame" x="254" y="0.0" width="48" height="30"/> 31 + <rect key="frame" x="254" y="0.0" width="48" height="48"/>
32 <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> 32 <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
33 <constraints> 33 <constraints>
34 <constraint firstAttribute="width" constant="48" id="Ubc-A7-ncs"/> 34 <constraint firstAttribute="width" constant="48" id="Ubc-A7-ncs"/>
......