Merge branch 'feature/coding' of https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui into feature/coding

This commit is contained in:
Pfeil, Scott Robert 2020-01-14 11:18:31 -05:00
commit 7790a20ad3

View File

@ -15,7 +15,7 @@ import MVMCore
public var action: ActionProtocol?
public var hideArrow: Bool?
public var line: LineModel?
public var style: String?
public var style: String? = "standard"
enum ListItemCodingKeys: String, CodingKey {
case backgroundColor
@ -31,10 +31,20 @@ import MVMCore
action = try typeContainer.decodeModelIfPresent(codingKey: .action, typeCodingKey: ActionCodingKey.actionType)
hideArrow = try typeContainer.decodeIfPresent(Bool.self, forKey: .hideArrow)
line = try typeContainer.decodeIfPresent(LineModel.self, forKey: .line)
style = try typeContainer.decodeIfPresent(String.self, forKey: .style)
if let style = try typeContainer.decodeIfPresent(String.self, forKey: .style) {
self.style = style
}
try super.init(from: decoder)
if useHorizontalMargins == nil {
useHorizontalMargins = true
}
if useVerticalMargins == nil {
useVerticalMargins = true
}
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: ListItemCodingKeys.self)
@ -43,5 +53,6 @@ import MVMCore
try container.encodeIfPresent(hideArrow, forKey: .hideArrow)
try container.encodeIfPresent(line, forKey: .line)
try container.encodeIfPresent(style, forKey: .style)
}
}
}