updates for polling

This commit is contained in:
Pfeil, Scott Robert 2020-10-15 10:37:36 -04:00
parent 87904151b1
commit 159798f0d8
2 changed files with 8 additions and 8 deletions

View File

@ -8,7 +8,7 @@
import Foundation import Foundation
public class CollapsableNotificationModel: NotificationModel { open class CollapsableNotificationModel: NotificationModel {
public class override var identifier: String { public class override var identifier: String {
return "collapsableNotification" return "collapsableNotification"
} }
@ -19,12 +19,12 @@ public class CollapsableNotificationModel: NotificationModel {
public var initiallyCollapsed = false public var initiallyCollapsed = false
public var pages: [String]? public var pages: [String]?
init(with topLabel: LabelModel, headline: LabelModel) { public init(with topLabel: LabelModel, headline: LabelModel) {
self.topLabel = topLabel self.topLabel = topLabel
super.init(with: headline) super.init(with: headline)
} }
override func setDefault() { open override func setDefault() {
super.setDefault() super.setDefault()
if topLabel.textColor == nil { if topLabel.textColor == nil {
topLabel.textColor = Color(uiColor: .white) topLabel.textColor = Color(uiColor: .white)
@ -61,7 +61,7 @@ public class CollapsableNotificationModel: NotificationModel {
try super.init(from: decoder) try super.init(from: decoder)
} }
public override func encode(to encoder: Encoder) throws { open override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder) try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self) var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(moleculeName, forKey: .moleculeName) try container.encode(moleculeName, forKey: .moleculeName)

View File

@ -8,7 +8,7 @@
import Foundation import Foundation
public class NotificationModel: MoleculeModelProtocol { open class NotificationModel: MoleculeModelProtocol {
public class var identifier: String { public class var identifier: String {
return "notification" return "notification"
} }
@ -18,11 +18,11 @@ public class NotificationModel: MoleculeModelProtocol {
public var button: ButtonModel? public var button: ButtonModel?
public var closeButton: NotificationXButtonModel? public var closeButton: NotificationXButtonModel?
init(with headline: LabelModel) { public init(with headline: LabelModel) {
self.headline = headline self.headline = headline
} }
func setDefault() { open func setDefault() {
if backgroundColor == nil { if backgroundColor == nil {
backgroundColor = Color(uiColor: .mvmGreen()) backgroundColor = Color(uiColor: .mvmGreen())
} }
@ -59,7 +59,7 @@ public class NotificationModel: MoleculeModelProtocol {
setDefault() setDefault()
} }
public func encode(to encoder: Encoder) throws { open func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self) var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(moleculeName, forKey: .moleculeName) try container.encode(moleculeName, forKey: .moleculeName)
try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor) try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor)