Manos Chorianopoulos

add pacing widget event

......@@ -191,17 +191,17 @@ var timer2: DispatchSourceTimer?
} else if (eventArray[1] == "couponShared") {
}
// else if (eventArray[2] == "serviceDisabled") {
// let pacingService = swiftApi.WarplyPacingEventModel()
// pacingService._isEnabled = false
// SwiftEventBus.post("pacing", sender: pacingService)
else if (eventArray[1] == "steps" && eventArray[2] == "widgetDisabled") {
let pacingWidget = swiftApi.WarplyPacingCardEventModel()
pacingWidget._isVisible = false
SwiftEventBus.post("pacing_widget", sender: pacingWidget)
// } else if (eventArray[2] == "serviceEnabled") {
// let pacingService = swiftApi.WarplyPacingEventModel()
// pacingService._isEnabled = true
// SwiftEventBus.post("pacing", sender: pacingService)
} else if (eventArray[1] == "steps" && eventArray[2] == "widgetEnabled") {
let pacingWidget = swiftApi.WarplyPacingCardEventModel()
pacingWidget._isVisible = true
SwiftEventBus.post("pacing_widget", sender: pacingWidget)
// }
}
else if (eventArray[1] == "steps" && eventArray[2] == "shortcutEnabled") {
let pacingEvent = swiftApi.WarplyPacingEventModel()
pacingEvent._isVisible = true
......
......@@ -3328,6 +3328,24 @@ public class swiftApi {
}
public class WarplyPacingCardEventModel {
private var isVisible: Bool
public init() {
self.isVisible = false
}
public var _isVisible: Bool {
get { // getter
return self.isVisible
}
set(newValue) { //setter
self.isVisible = newValue
}
}
}
public func openQuestionnaire(_ controller: UIViewController) -> Void {
for item in GlobalVariables.campaigns {
if (item.offer_category == "questionnaire") {
......