Manos Chorianopoulos

add WarplyPacingEventModel and fix pacing events

......@@ -59,24 +59,24 @@ import SwiftEventBus
SwiftEventBus.post("coupon_retrieved", sender: couponEvent)
} else if (eventArray[2] == "serviceDisabled") {
let pacingService = swiftApi.WarplyPacingCardServiceEnabledModel()
let pacingService = swiftApi.WarplyPacingEventModel()
pacingService._isEnabled = false
SwiftEventBus.post("pacing_service", sender: pacingService)
SwiftEventBus.post("pacing", sender: pacingService)
} else if (eventArray[2] == "serviceEnabled") {
let pacingService = swiftApi.WarplyPacingCardServiceEnabledModel()
let pacingService = swiftApi.WarplyPacingEventModel()
pacingService._isEnabled = true
SwiftEventBus.post("pacing_service", sender: pacingService)
SwiftEventBus.post("pacing", sender: pacingService)
} else if (eventArray[2] == "shortcutEnabled") {
let pacingEvent = swiftApi.WarplyPacingCardEventModel()
let pacingEvent = swiftApi.WarplyPacingEventModel()
pacingEvent._isVisible = true
SwiftEventBus.post("pacing_visible", sender: pacingEvent)
SwiftEventBus.post("pacing", sender: pacingEvent)
} else if (eventArray[2] == "shortcutDisabled") {
let pacingEvent = swiftApi.WarplyPacingCardEventModel()
let pacingEvent = swiftApi.WarplyPacingEventModel()
pacingEvent._isVisible = false
SwiftEventBus.post("pacing_visible", sender: pacingEvent)
SwiftEventBus.post("pacing", sender: pacingEvent)
} else if (eventArray[1] == "request" || eventArray[1] == "response") {
print("**************** WARPLY Webview Log START *****************")
......
......@@ -2034,39 +2034,30 @@ public class swiftApi {
}
public class WarplyPacingCardEventModel {
public class WarplyPacingEventModel {
private var isEnabled: Bool
private var isVisible: Bool
public init() {
self.isEnabled = false
self.isVisible = false
}
public var _isVisible: Bool {
public var _isEnabled: Bool {
get { // getter
return self.isVisible
return self.isEnabled
}
set(newValue) { //setter
self.isVisible = newValue
}
}
self.isEnabled = newValue
}
public class WarplyPacingCardServiceEnabledModel {
private var isEnabled: Bool
public init() {
self.isEnabled = false
}
public var _isEnabled: Bool {
public var _isVisible: Bool {
get { // getter
return self.isEnabled
return self.isVisible
}
set(newValue) { //setter
self.isEnabled = newValue
self.isVisible = newValue
}
}
}
......