stack item change decoding

This commit is contained in:
Pfeil, Scott Robert 2020-01-13 22:18:40 -05:00
parent 96d533780f
commit 461a51d880

View File

@ -29,7 +29,7 @@ import Foundation
required public init(from decoder: Decoder) throws {
let typeContainer = try decoder.container(keyedBy: StackCodingKeys.self)
molecules = try typeContainer.decodeMolecules(codingKey: .molecules) as! [StackItemModel]
molecules = try typeContainer.decode([StackItemModel].self, forKey: .molecules)
if let axisString = try typeContainer.decodeIfPresent(String.self, forKey: .axis), let optionalAxis = NSLayoutConstraint.Axis(rawValue: axisString) {
axis = optionalAxis
}