Manos Chorianopoulos

fix navbar shadow

...@@ -52,13 +52,6 @@ extension UIViewController { ...@@ -52,13 +52,6 @@ extension UIViewController {
52 navigationItem.standardAppearance = navigationBarAppearance 52 navigationItem.standardAppearance = navigationBarAppearance
53 navigationItem.compactAppearance = navigationBarAppearance 53 navigationItem.compactAppearance = navigationBarAppearance
54 navigationItem.scrollEdgeAppearance = navigationBarAppearance 54 navigationItem.scrollEdgeAppearance = navigationBarAppearance
55 -
56 - // Add shadow
57 - self.navigationController?.navigationBar.layer.masksToBounds = false
58 - self.navigationController?.navigationBar.layer.shadowColor = UIColor.lightGray.cgColor
59 - self.navigationController?.navigationBar.layer.shadowOpacity = 0.8
60 - self.navigationController?.navigationBar.layer.shadowOffset = CGSize(width: 0, height: 2.0)
61 - self.navigationController?.navigationBar.layer.shadowRadius = 2
62 } 55 }
63 56
64 57
...@@ -66,6 +59,15 @@ extension UIViewController { ...@@ -66,6 +59,15 @@ extension UIViewController {
66 self.navigationController?.popViewController(animated: true) 59 self.navigationController?.popViewController(animated: true)
67 self.dismiss(animated: true, completion: {}) 60 self.dismiss(animated: true, completion: {})
68 } 61 }
62 +
63 + func addNavShadow() {
64 + // Add shadow
65 + self.navigationController?.navigationBar.layer.masksToBounds = false
66 + self.navigationController?.navigationBar.layer.shadowColor = UIColor.lightGray.cgColor
67 + self.navigationController?.navigationBar.layer.shadowOpacity = 0.8
68 + self.navigationController?.navigationBar.layer.shadowOffset = CGSize(width: 0, height: 2.0)
69 + self.navigationController?.navigationBar.layer.shadowRadius = 2
70 + }
69 71
70 func setNavigationTitle(_ title: String, _ fontWeight: String? = "medium") { 72 func setNavigationTitle(_ title: String, _ fontWeight: String? = "medium") {
71 let uiscreen: CGRect = UIScreen.main.bounds 73 let uiscreen: CGRect = UIScreen.main.bounds
......
...@@ -291,6 +291,8 @@ import SwiftEventBus ...@@ -291,6 +291,8 @@ import SwiftEventBus
291 291
292 public override func viewWillAppear(_ animated: Bool) { 292 public override func viewWillAppear(_ animated: Bool) {
293 super.viewWillAppear(animated) 293 super.viewWillAppear(animated)
294 +
295 + addNavShadow()
294 296
295 let userTag = swiftApi().getUserTag() 297 let userTag = swiftApi().getUserTag()
296 if (questionnaireButton.currentTitle != userTag) { 298 if (questionnaireButton.currentTitle != userTag) {
...@@ -327,6 +329,15 @@ import SwiftEventBus ...@@ -327,6 +329,15 @@ import SwiftEventBus
327 329
328 self.coupons = swiftApi().getCouponList() 330 self.coupons = swiftApi().getCouponList()
329 self.tableView.reloadData() 331 self.tableView.reloadData()
332 +
333 + self.startTimer()
334 + }
335 +
336 + public override func viewWillDisappear(_ animated: Bool) {
337 + super.viewWillDisappear(animated)
338 +
339 + self.stopTimer()
340 + self.navigationController?.navigationBar.layer.shadowOpacity = 0.0
330 } 341 }
331 342
332 public override func viewDidLayoutSubviews() { 343 public override func viewDidLayoutSubviews() {
......