Manos Chorianopoulos

fix navbar shadow

......@@ -52,13 +52,6 @@ extension UIViewController {
navigationItem.standardAppearance = navigationBarAppearance
navigationItem.compactAppearance = navigationBarAppearance
navigationItem.scrollEdgeAppearance = navigationBarAppearance
// Add shadow
self.navigationController?.navigationBar.layer.masksToBounds = false
self.navigationController?.navigationBar.layer.shadowColor = UIColor.lightGray.cgColor
self.navigationController?.navigationBar.layer.shadowOpacity = 0.8
self.navigationController?.navigationBar.layer.shadowOffset = CGSize(width: 0, height: 2.0)
self.navigationController?.navigationBar.layer.shadowRadius = 2
}
......@@ -66,6 +59,15 @@ extension UIViewController {
self.navigationController?.popViewController(animated: true)
self.dismiss(animated: true, completion: {})
}
func addNavShadow() {
// Add shadow
self.navigationController?.navigationBar.layer.masksToBounds = false
self.navigationController?.navigationBar.layer.shadowColor = UIColor.lightGray.cgColor
self.navigationController?.navigationBar.layer.shadowOpacity = 0.8
self.navigationController?.navigationBar.layer.shadowOffset = CGSize(width: 0, height: 2.0)
self.navigationController?.navigationBar.layer.shadowRadius = 2
}
func setNavigationTitle(_ title: String, _ fontWeight: String? = "medium") {
let uiscreen: CGRect = UIScreen.main.bounds
......
......@@ -291,6 +291,8 @@ import SwiftEventBus
public override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
addNavShadow()
let userTag = swiftApi().getUserTag()
if (questionnaireButton.currentTitle != userTag) {
......@@ -327,6 +329,15 @@ import SwiftEventBus
self.coupons = swiftApi().getCouponList()
self.tableView.reloadData()
self.startTimer()
}
public override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
self.stopTimer()
self.navigationController?.navigationBar.layer.shadowOpacity = 0.0
}
public override func viewDidLayoutSubviews() {
......