Manos Chorianopoulos

fix MarketPassViewController mapButtonAction

......@@ -191,10 +191,7 @@ import AVFoundation
// MARK: - Actions
@IBAction func mapButtonAction(_ sender: Any) {
let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
let vc = storyboard.instantiateViewController(withIdentifier: "CampaignViewController") as! SwiftWarplyFramework.CampaignViewController
vc.campaignUrl = swiftApi().getMarketPassMapUrl()
self.navigationController?.pushViewController(vc, animated: true)
swiftApi().openSupermarketMap(self)
}
}
......
......@@ -9366,4 +9366,22 @@ public class swiftApi {
}
}
public func openSupermarketMap(_ controller: UIViewController) -> Void {
let status = swiftApi().getNetworkStatus()
if (status == -1 || status == 0) {
swiftApi().showDialog(controller, "Δεν υπάρχει σύνδεση","Αυτή τη στιγμή βρίσκεσαι εκτός σύνδεσης. Παρακαλούμε βεβαιώσου ότι είσαι συνδεδεμένος στο διαδίκτυο και προσπάθησε ξανά.")
} else {
let tempCampaign = CampaignItemModel()
let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
let vc = storyboard.instantiateViewController(withIdentifier: "CampaignViewController") as! SwiftWarplyFramework.CampaignViewController
let url = swiftApi().getMarketPassMapUrl()
let params = swiftApi().constructCampaignParams(tempCampaign)
vc.campaignUrl = url
vc.params = params
vc.showHeader = false
controller.navigationController?.pushViewController(vc, animated: true)
}
}
}
......