Manos Chorianopoulos

add pacing widget event

...@@ -191,17 +191,17 @@ var timer2: DispatchSourceTimer? ...@@ -191,17 +191,17 @@ var timer2: DispatchSourceTimer?
191 } else if (eventArray[1] == "couponShared") { 191 } else if (eventArray[1] == "couponShared") {
192 192
193 } 193 }
194 - // else if (eventArray[2] == "serviceDisabled") { 194 + else if (eventArray[1] == "steps" && eventArray[2] == "widgetDisabled") {
195 - // let pacingService = swiftApi.WarplyPacingEventModel() 195 + let pacingWidget = swiftApi.WarplyPacingCardEventModel()
196 - // pacingService._isEnabled = false 196 + pacingWidget._isVisible = false
197 - // SwiftEventBus.post("pacing", sender: pacingService) 197 + SwiftEventBus.post("pacing_widget", sender: pacingWidget)
198 198
199 - // } else if (eventArray[2] == "serviceEnabled") { 199 + } else if (eventArray[1] == "steps" && eventArray[2] == "widgetEnabled") {
200 - // let pacingService = swiftApi.WarplyPacingEventModel() 200 + let pacingWidget = swiftApi.WarplyPacingCardEventModel()
201 - // pacingService._isEnabled = true 201 + pacingWidget._isVisible = true
202 - // SwiftEventBus.post("pacing", sender: pacingService) 202 + SwiftEventBus.post("pacing_widget", sender: pacingWidget)
203 203
204 - // } 204 + }
205 else if (eventArray[1] == "steps" && eventArray[2] == "shortcutEnabled") { 205 else if (eventArray[1] == "steps" && eventArray[2] == "shortcutEnabled") {
206 let pacingEvent = swiftApi.WarplyPacingEventModel() 206 let pacingEvent = swiftApi.WarplyPacingEventModel()
207 pacingEvent._isVisible = true 207 pacingEvent._isVisible = true
......
...@@ -3328,6 +3328,24 @@ public class swiftApi { ...@@ -3328,6 +3328,24 @@ public class swiftApi {
3328 } 3328 }
3329 3329
3330 3330
3331 + public class WarplyPacingCardEventModel {
3332 + private var isVisible: Bool
3333 +
3334 + public init() {
3335 + self.isVisible = false
3336 + }
3337 +
3338 + public var _isVisible: Bool {
3339 + get { // getter
3340 + return self.isVisible
3341 + }
3342 + set(newValue) { //setter
3343 + self.isVisible = newValue
3344 + }
3345 + }
3346 + }
3347 +
3348 +
3331 public func openQuestionnaire(_ controller: UIViewController) -> Void { 3349 public func openQuestionnaire(_ controller: UIViewController) -> Void {
3332 for item in GlobalVariables.campaigns { 3350 for item in GlobalVariables.campaigns {
3333 if (item.offer_category == "questionnaire") { 3351 if (item.offer_category == "questionnaire") {
......