From fabd4026d3538f8d40bdc7c4473b82f72c73cbf7 Mon Sep 17 00:00:00 2001 From: Dibya Malla Date: Tue, 21 Mar 2023 21:15:52 +0545 Subject: [PATCH] [Added] Corner shadows in swift --- GME Remit/Extensions/UIView+Ext.swift | 2 -- .../View/Cell/HomeCollectionTableViewCell.swift | 11 ++++++----- .../User Interface/View/Custom/HomeCarouselView.swift | 2 +- .../Home/User Interface/View/HomeViewController.swift | 7 +++++++ 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/GME Remit/Extensions/UIView+Ext.swift b/GME Remit/Extensions/UIView+Ext.swift index 1a941308..deaaa911 100644 --- a/GME Remit/Extensions/UIView+Ext.swift +++ b/GME Remit/Extensions/UIView+Ext.swift @@ -649,9 +649,7 @@ extension UIView { if let centerY = centerY { centerYAnchor.constraint(equalTo: centerY , constant: paddingY).isActive = true } - } - } extension UIStackView { diff --git a/GME Remit/Modules/Home/User Interface/View/Cell/HomeCollectionTableViewCell.swift b/GME Remit/Modules/Home/User Interface/View/Cell/HomeCollectionTableViewCell.swift index 5b441a79..985f98cd 100644 --- a/GME Remit/Modules/Home/User Interface/View/Cell/HomeCollectionTableViewCell.swift +++ b/GME Remit/Modules/Home/User Interface/View/Cell/HomeCollectionTableViewCell.swift @@ -55,6 +55,7 @@ class HomeCollectionTableViewCell: UITableViewCell { }() @IBOutlet weak var containerView: UIStackView! + @IBOutlet weak var collectionView: UICollectionView! private var menus: [HomeCollectionModel]? weak var homeCollectionDelegate: HomeCollectionDelegate? @@ -74,11 +75,11 @@ class HomeCollectionTableViewCell: UITableViewCell { } func setup(_ rates: [ExchangeRateModel]?) { -// collectionView.addObserver( -// self, forKeyPath: "contentSize", -// options: NSKeyValueObservingOptions.old, -// context: nil -// ) + collectionView.addObserver( + self, forKeyPath: "contentSize", + options: NSKeyValueObservingOptions.old, + context: nil + ) exchangeRateView.set(rates) diff --git a/GME Remit/Modules/Home/User Interface/View/Custom/HomeCarouselView.swift b/GME Remit/Modules/Home/User Interface/View/Custom/HomeCarouselView.swift index fa918817..18337ff2 100644 --- a/GME Remit/Modules/Home/User Interface/View/Custom/HomeCarouselView.swift +++ b/GME Remit/Modules/Home/User Interface/View/Custom/HomeCarouselView.swift @@ -24,7 +24,7 @@ class HomeCarouselView: UIView { private let pageControl: CustomPageControl = { let view = CustomPageControl(frame: .zero) - view.currentPageIndicatorTintColor = .theme2E89FF + view.currentPageIndicatorTintColor = .themeBlack view.pageIndicatorTintColor = .themeGray2 view.translatesAutoresizingMaskIntoConstraints = false return view diff --git a/GME Remit/Modules/Home/User Interface/View/HomeViewController.swift b/GME Remit/Modules/Home/User Interface/View/HomeViewController.swift index 18ead263..118b76b2 100644 --- a/GME Remit/Modules/Home/User Interface/View/HomeViewController.swift +++ b/GME Remit/Modules/Home/User Interface/View/HomeViewController.swift @@ -270,6 +270,8 @@ class HomeViewController: UIViewController { object: nil ) + self.navigationController?.navigationBar.setValue(true, forKey: "hidesShadow") + } override func viewWillAppear(_ animated: Bool) { @@ -288,6 +290,10 @@ class HomeViewController: UIViewController { } } + override func viewDidLayoutSubviews() { + super.viewDidLayoutSubviews() + } + override func viewWillDisappear(_ animated: Bool) { super.viewWillDisappear(animated) self.navigationItem.title = "" @@ -322,6 +328,7 @@ class HomeViewController: UIViewController { private func setupHierachy() { accountDetailView.setupCornerRadius(20,maskedCorners: [.layerMinXMaxYCorner, .layerMaxXMaxYCorner]) + accountDetailView.layer.addShadow(with: UIColor.gray, shadowRadius: 10.0, shadowOffset: CGSize(width: 0, height: 1)) uploadSlipButton.titleLabel?.font = .sanfrancisco(.bold, size: 12) uploadSlipButton.set(cornerRadius: 20)