Manos Chorianopoulos

myCoupons fixes

......@@ -56,6 +56,8 @@ let package = Package(
.process("screens/CampaignViewController/CampaignViewController.xib"),
.process("cells/MyRewardsOfferCollectionViewCell/MyRewardsOfferCollectionViewCell.xib"),
.process("cells/MyRewardsBannerOffersScrollTableViewCell/MyRewardsBannerOffersScrollTableViewCell.xib")
.process("cells/MyCouponsViewController/MyCouponsViewController.xib")
.process("cells/MyCouponsHeaderTableViewCell/MyCouponsHeaderTableViewCell.xib")
]
),
]
......
......@@ -7,7 +7,7 @@
<key>Pods-SwiftWarplyFramework.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
<integer>0</integer>
</dict>
</dict>
</dict>
......
......@@ -7,7 +7,7 @@
<key>SwiftWarplyFramework.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
<integer>1</integer>
</dict>
</dict>
</dict>
......
......@@ -36,55 +36,96 @@ extension UIViewController {
])
}
func setBackButton(_ icon:String = "ic_back_3") {
// let uiscreen: CGRect = UIScreen.main.bounds
// let backButton = UIButton(type: UIButton.ButtonType.custom) as UIButton
// if (icon == "ic_close_2") {
// backButton.frame = CGRect(x: 0, y: 0, width: 18, height: 18)
// } else {
// backButton.frame = CGRect(x: 0, y: 0, width: 18, height: 18)
// func setBackButton(_ icon:String = "ic_back_3") {
// // let uiscreen: CGRect = UIScreen.main.bounds
// // let backButton = UIButton(type: UIButton.ButtonType.custom) as UIButton
// // if (icon == "ic_close_2") {
// // backButton.frame = CGRect(x: 0, y: 0, width: 18, height: 18)
// // } else {
// // backButton.frame = CGRect(x: 0, y: 0, width: 18, height: 18)
// // }
// // // backButton.frame = CGRect(x: 0, y: 0, width: uiscreen.height * 0.01, height: uiscreen.height * 0.01)
// // // backButton.backgroundColor = .red
// // backButton.imageView!.contentMode = .scaleAspectFit
// // //backButton.setBackgroundImage(UIImage(named:Assets.Navigation.backButton), for: UIControlState())
// // // backButton.setImage(UIImage(named: icon), for: .normal)
// // backButton.setBackgroundImage(UIImage(named: icon), for: .normal)
// // // backButton.imageEdgeInsets = UIEdgeInsets(top: 0, left: -20, bottom: 0, right: 0)
// // backButton.addTarget(self, action: #selector(moveToBack(_:)), for: .touchUpInside)
// // backButton.translatesAutoresizingMaskIntoConstraints = false
// // // Add width, height constraints
// // if (icon == "ic_close_2") {
// // let widthContraints = NSLayoutConstraint(item: backButton, attribute: NSLayoutConstraint.Attribute.width, relatedBy: NSLayoutConstraint.Relation.equal, toItem: nil, attribute: NSLayoutConstraint.Attribute.notAnAttribute, multiplier: 1, constant: 18)
// // let heightContraints = NSLayoutConstraint(item: backButton, attribute: NSLayoutConstraint.Attribute.height, relatedBy: NSLayoutConstraint.Relation.equal, toItem: nil, attribute: NSLayoutConstraint.Attribute.notAnAttribute, multiplier: 1, constant: 18)
// // NSLayoutConstraint.activate([heightContraints,widthContraints])
// // } else {
// // let widthContraints = NSLayoutConstraint(item: backButton, attribute: NSLayoutConstraint.Attribute.width, relatedBy: NSLayoutConstraint.Relation.equal, toItem: nil, attribute: NSLayoutConstraint.Attribute.notAnAttribute, multiplier: 1, constant: 18)
// // let heightContraints = NSLayoutConstraint(item: backButton, attribute: NSLayoutConstraint.Attribute.height, relatedBy: NSLayoutConstraint.Relation.equal, toItem: nil, attribute: NSLayoutConstraint.Attribute.notAnAttribute, multiplier: 1, constant: 18)
// // NSLayoutConstraint.activate([heightContraints,widthContraints])
// // }
// // let leftBarButtonItem: UIBarButtonItem = UIBarButtonItem(customView: backButton)
// // NSLayoutConstraint.activate([(leftBarButtonItem.customView!.widthAnchor.constraint(equalToConstant: 18)),(leftBarButtonItem.customView!.heightAnchor.constraint(equalToConstant: 18))])
// // self.navigationItem.setLeftBarButton(leftBarButtonItem, animated: false)
// self.navigationItem.setHidesBackButton(true, animated:false)
// //your custom view for back image with custom size
// let view = UIView(frame: CGRect(x: 0, y: 0, width: 40, height: 40))
// let imageView = UIImageView(frame: CGRect(x: 10, y: 12, width: 15, height: 15))
// if let imgBackArrow = UIImage(named: icon, in: Bundle.frameworkResourceBundle, compatibleWith: nil) {
// imageView.image = imgBackArrow
// }
// // backButton.frame = CGRect(x: 0, y: 0, width: uiscreen.height * 0.01, height: uiscreen.height * 0.01)
// // backButton.backgroundColor = .red
// backButton.imageView!.contentMode = .scaleAspectFit
// //backButton.setBackgroundImage(UIImage(named:Assets.Navigation.backButton), for: UIControlState())
// // backButton.setImage(UIImage(named: icon), for: .normal)
// backButton.setBackgroundImage(UIImage(named: icon), for: .normal)
// // backButton.imageEdgeInsets = UIEdgeInsets(top: 0, left: -20, bottom: 0, right: 0)
// backButton.addTarget(self, action: #selector(moveToBack(_:)), for: .touchUpInside)
// backButton.translatesAutoresizingMaskIntoConstraints = false
// // Add width, height constraints
// if (icon == "ic_close_2") {
// let widthContraints = NSLayoutConstraint(item: backButton, attribute: NSLayoutConstraint.Attribute.width, relatedBy: NSLayoutConstraint.Relation.equal, toItem: nil, attribute: NSLayoutConstraint.Attribute.notAnAttribute, multiplier: 1, constant: 18)
// let heightContraints = NSLayoutConstraint(item: backButton, attribute: NSLayoutConstraint.Attribute.height, relatedBy: NSLayoutConstraint.Relation.equal, toItem: nil, attribute: NSLayoutConstraint.Attribute.notAnAttribute, multiplier: 1, constant: 18)
// NSLayoutConstraint.activate([heightContraints,widthContraints])
// view.addSubview(imageView)
// let backTap = UITapGestureRecognizer(target: self, action: #selector(moveToBack(_:)))
// view.addGestureRecognizer(backTap)
// let leftBarButtonItem = UIBarButtonItem(customView: view )
// self.navigationItem.leftBarButtonItem = leftBarButtonItem
// self.navigationItem.title = ""
// // Add backgroundColor
// if #available(iOS 15, *) {
// let navigationBarAppearance = UINavigationBarAppearance()
// navigationBarAppearance.configureWithDefaultBackground()
// navigationBarAppearance.backgroundColor = .white
// navigationItem.standardAppearance = navigationBarAppearance
// navigationItem.compactAppearance = navigationBarAppearance
// navigationItem.scrollEdgeAppearance = navigationBarAppearance
// } else {
// let widthContraints = NSLayoutConstraint(item: backButton, attribute: NSLayoutConstraint.Attribute.width, relatedBy: NSLayoutConstraint.Relation.equal, toItem: nil, attribute: NSLayoutConstraint.Attribute.notAnAttribute, multiplier: 1, constant: 18)
// let heightContraints = NSLayoutConstraint(item: backButton, attribute: NSLayoutConstraint.Attribute.height, relatedBy: NSLayoutConstraint.Relation.equal, toItem: nil, attribute: NSLayoutConstraint.Attribute.notAnAttribute, multiplier: 1, constant: 18)
// NSLayoutConstraint.activate([heightContraints,widthContraints])
// navigationController?.navigationBar.barTintColor = UIColor.white
// navigationController?.navigationBar.tintColor = UIColor.white
// // navigationController?.navigationBar.isTranslucent = false
// }
// let leftBarButtonItem: UIBarButtonItem = UIBarButtonItem(customView: backButton)
// NSLayoutConstraint.activate([(leftBarButtonItem.customView!.widthAnchor.constraint(equalToConstant: 18)),(leftBarButtonItem.customView!.heightAnchor.constraint(equalToConstant: 18))])
// self.navigationItem.setLeftBarButton(leftBarButtonItem, animated: false)
// // Remove navigationBar bottom border
// // self.navigationController?.navigationBar.hideBottomHairline()
// self.navigationController?.hideHairline()
// self.navigationController?.navigationBar.setBackgroundImage(UIImage(), for:.default)
// self.navigationController?.navigationBar.shadowImage = UIImage()
// self.navigationController?.navigationBar.layoutIfNeeded()
// }
self.navigationItem.setHidesBackButton(true, animated:false)
func setBackButton(_ icon:String = "ic_back_4") {
self.navigationItem.setHidesBackButton(true, animated: false)
//your custom view for back image with custom size
let view = UIView(frame: CGRect(x: 0, y: 0, width: 40, height: 40))
let imageView = UIImageView(frame: CGRect(x: 10, y: 12, width: 15, height: 15))
let button = UIButton(type: .custom)
button.frame = CGRect(x: 0, y: 0, width: 24, height: 24)
button.imageView?.contentMode = .scaleAspectFit
if let imgBackArrow = UIImage(named: icon, in: Bundle.frameworkResourceBundle, compatibleWith: nil) {
imageView.image = imgBackArrow
if let img = UIImage(named: icon, in: Bundle.frameworkResourceBundle, compatibleWith: nil) {
button.setImage(img, for: .normal)
}
view.addSubview(imageView)
let backTap = UITapGestureRecognizer(target: self, action: #selector(moveToBack(_:)))
view.addGestureRecognizer(backTap)
button.addTarget(self, action: #selector(moveToBack(_:)), for: .touchUpInside)
let leftBarButtonItem = UIBarButtonItem(customView: view )
self.navigationItem.leftBarButtonItem = leftBarButtonItem
......
......@@ -10,25 +10,25 @@
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="KGk-i7-Jjw" customClass="MyCouponsHeaderTableViewCell" customModule="SwiftWarplyFramework" customModuleProvider="target">
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="MyCouponsHeaderTableViewCell" id="KGk-i7-Jjw" customClass="MyCouponsHeaderTableViewCell" customModule="SwiftWarplyFramework" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
<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="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="9zr-3O-Ndy" userLabel="ParentView">
<view contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="9zr-3O-Ndy" userLabel="ParentView">
<rect key="frame" x="0.0" y="0.0" width="320" height="30"/>
<subviews>
<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">
<rect key="frame" x="18" y="-0.66666666666666607" width="156.33333333333334" height="31.333333333333329"/>
<rect key="frame" x="18" y="8.6666666666666643" width="156.33333333333334" height="31"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<fontDescription key="fontDescription" name="HelveticaNeue-Bold" family="Helvetica Neue" pointSize="26"/>
<color key="textColor" red="0.067000000000000004" green="0.067000000000000004" blue="0.067000000000000004" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="NOc-fo-goN" userLabel="SearchButton">
<rect key="frame" x="254" y="0.0" width="48" height="30"/>
<rect key="frame" x="254" y="0.0" width="48" height="48"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="width" constant="48" id="Ubc-A7-ncs"/>
......