Manos Chorianopoulos

fix double navigation bars at questionnaire

...@@ -15,6 +15,21 @@ import SwiftEventBus ...@@ -15,6 +15,21 @@ import SwiftEventBus
15 15
16 public var campaignUrl: String = "" 16 public var campaignUrl: String = ""
17 public var params: String = "" 17 public var params: String = ""
18 + public var showHeader: Bool = true
19 +
20 + public override func viewWillAppear(_ animated: Bool) {
21 + super.viewWillAppear(animated)
22 + if (!showHeader) {
23 + navigationController?.setNavigationBarHidden(true, animated: animated)
24 + }
25 + }
26 +
27 + public override func viewWillDisappear(_ animated: Bool) {
28 + super.viewWillDisappear(animated)
29 + if (!showHeader) {
30 + navigationController?.setNavigationBarHidden(false, animated: animated)
31 + }
32 + }
18 33
19 public override func viewDidLoad() { 34 public override func viewDidLoad() {
20 super.viewDidLoad() 35 super.viewDidLoad()
...@@ -24,7 +39,9 @@ import SwiftEventBus ...@@ -24,7 +39,9 @@ import SwiftEventBus
24 39
25 self.hidesBottomBarWhenPushed = true 40 self.hidesBottomBarWhenPushed = true
26 41
42 + if (showHeader) {
27 setBackButton() 43 setBackButton()
44 + }
28 45
29 webview.navigationDelegate = self 46 webview.navigationDelegate = self
30 if let url = URL(string: campaignUrl ?? "") { 47 if let url = URL(string: campaignUrl ?? "") {
......
...@@ -3143,6 +3143,7 @@ public class swiftApi { ...@@ -3143,6 +3143,7 @@ public class swiftApi {
3143 let params = swiftApi().constructCampaignParams(item) 3143 let params = swiftApi().constructCampaignParams(item)
3144 vc.campaignUrl = url 3144 vc.campaignUrl = url
3145 vc.params = params 3145 vc.params = params
3146 + vc.showHeader = false
3146 controller.navigationController?.pushViewController(vc, animated: true) 3147 controller.navigationController?.pushViewController(vc, animated: true)
3147 break; 3148 break;
3148 } 3149 }
......