Manos Chorianopoulos

add openQuestionnaire, setCampaignList

...@@ -1239,4 +1239,21 @@ public class swiftApi { ...@@ -1239,4 +1239,21 @@ public class swiftApi {
1239 } 1239 }
1240 } 1240 }
1241 1241
1242 +
1243 + public func openQuestionnaire(controller: UIViewController) -> Void {
1244 + for item in GlobalVariables.campaigns {
1245 + if (item.offer_category == "questionnaire") {
1246 + let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
1247 + let vc = storyboard.instantiateViewController(withIdentifier: "CampaignViewController") as! CampaignViewController
1248 + vc.campaignUrl = item.index_url ?? ""
1249 + controller.navigationController?.pushViewController(vc, animated: true)
1250 + break;
1251 + }
1252 + }
1253 + }
1254 +
1255 + public func setCampaignList(_ campaigns: Array<CampaignItemModel>) -> Void {
1256 + GlobalVariables.campaigns = campaigns
1257 + }
1258 +
1242 } 1259 }
......