move to new molecule decoding convenience method

This commit is contained in:
Kyle Matthew Hedden 2021-04-08 14:21:53 -04:00
parent a5a655c0e7
commit 3c1afd9080

View File

@ -61,9 +61,9 @@ public class ListLeftVariableIconWithRightCaretModel: ListItemModel, ParentMolec
required public init(from decoder: Decoder) throws {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
leftLabel = try typeContainer.decodeMoleculeIfPresent(codingKey: .leftLabel)!
rightLabel = try typeContainer.decodeMoleculeIfPresent(codingKey: .rightLabel)!
image = try typeContainer.decodeMoleculeIfPresent(codingKey: .image)!
leftLabel = try typeContainer.decodeMolecule(codingKey: .leftLabel)
rightLabel = try typeContainer.decodeMolecule(codingKey: .rightLabel)
image = try typeContainer.decodeMolecule(codingKey: .image)
try super.init(from: decoder)
}