Showing
2 changed files
with
15 additions
and
2 deletions
... | @@ -23,6 +23,7 @@ var timer2: DispatchSourceTimer? | ... | @@ -23,6 +23,7 @@ var timer2: DispatchSourceTimer? |
23 | public var campaignUrl: String = "" | 23 | public var campaignUrl: String = "" |
24 | public var params: String = "" | 24 | public var params: String = "" |
25 | public var showHeader: Bool = false | 25 | public var showHeader: Bool = false |
26 | + public var isPresented: Bool = false | ||
26 | 27 | ||
27 | // Location Permissions | 28 | // Location Permissions |
28 | var webView: WKWebView! | 29 | var webView: WKWebView! |
... | @@ -541,7 +542,11 @@ var timer2: DispatchSourceTimer? | ... | @@ -541,7 +542,11 @@ var timer2: DispatchSourceTimer? |
541 | if (eventArray[0] == "event") { | 542 | if (eventArray[0] == "event") { |
542 | if (eventArray[1] == "closeArtwork") { | 543 | if (eventArray[1] == "closeArtwork") { |
543 | self.mWebviewSupermarket = false | 544 | self.mWebviewSupermarket = false |
544 | - self.navigationController?.popViewController(animated: true) | 545 | + if (isPresented) { |
546 | + self.dismiss(animated: true, completion: nil) | ||
547 | + } else { | ||
548 | + self.navigationController?.popViewController(animated: true) | ||
549 | + } | ||
545 | 550 | ||
546 | } else if (eventArray[1] == "addUserTag") { | 551 | } else if (eventArray[1] == "addUserTag") { |
547 | // SwiftEventBus.post("questionnaire", sender: questionnaireEvent) | 552 | // SwiftEventBus.post("questionnaire", sender: questionnaireEvent) | ... | ... |
... | @@ -9401,7 +9401,15 @@ public class swiftApi { | ... | @@ -9401,7 +9401,15 @@ public class swiftApi { |
9401 | vc.campaignUrl = url | 9401 | vc.campaignUrl = url |
9402 | vc.params = params | 9402 | vc.params = params |
9403 | vc.showHeader = false | 9403 | vc.showHeader = false |
9404 | - controller.navigationController?.pushViewController(vc, animated: true) | 9404 | + |
9405 | + if (controller.navigationController != nil) { | ||
9406 | + vc.isPresented = false | ||
9407 | + controller.navigationController?.pushViewController(vc, animated: true) | ||
9408 | + } else { | ||
9409 | + vc.isPresented = true | ||
9410 | + vc.modalPresentationStyle = .fullScreen | ||
9411 | + controller.present(vc, animated: true, completion: nil) | ||
9412 | + } | ||
9405 | } | 9413 | } |
9406 | } | 9414 | } |
9407 | 9415 | ... | ... |
-
Please register or login to post a comment