updated model
This commit is contained in:
parent
b4859988c2
commit
e6079eab55
@ -12,20 +12,6 @@ import Foundation
|
|||||||
public var backgroundColor: String?
|
public var backgroundColor: String?
|
||||||
public static var identifier: String = "numberedList"
|
public static var identifier: String = "numberedList"
|
||||||
public var list: [LabelModel]
|
public var list: [LabelModel]
|
||||||
|
|
||||||
enum CodingKeys: String, CodingKey {
|
|
||||||
case list
|
|
||||||
}
|
|
||||||
|
|
||||||
required public init(from decoder: Decoder) throws {
|
|
||||||
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
|
||||||
self.list = try typeContainer.decodeMolecules(codingKey: .list) as! [LabelModel]
|
|
||||||
}
|
|
||||||
|
|
||||||
public func encode(to encoder: Encoder) throws {
|
|
||||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
||||||
try container.encodeModels(list, forKey: .list)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public protocol OrderListProtocol: MoleculeProtocol {
|
public protocol OrderListProtocol: MoleculeProtocol {
|
||||||
|
|||||||
@ -9,26 +9,8 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
@objcMembers public class UnOrderedListModel: OrderListProtocol {
|
@objcMembers public class UnOrderedListModel: OrderListProtocol {
|
||||||
|
|
||||||
public var backgroundColor: String?
|
public var backgroundColor: String?
|
||||||
public static var identifier: String = "unOrderedList"
|
public static var identifier: String = "unOrderedList"
|
||||||
public var bulletChar: String?
|
public var bulletChar: String?
|
||||||
public var list: [LabelModel]
|
public var list: [LabelModel]
|
||||||
|
|
||||||
enum CodingKeys: String, CodingKey {
|
|
||||||
case list
|
|
||||||
case bulletChar
|
|
||||||
}
|
|
||||||
|
|
||||||
required public init(from decoder: Decoder) throws {
|
|
||||||
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
|
||||||
self.bulletChar = try typeContainer.decodeIfPresent(String.self, forKey: .bulletChar)
|
|
||||||
self.list = try typeContainer.decodeMolecules(codingKey: .list) as! [LabelModel]
|
|
||||||
}
|
|
||||||
|
|
||||||
public func encode(to encoder: Encoder) throws {
|
|
||||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
||||||
try container.encodeIfPresent(bulletChar, forKey: .bulletChar)
|
|
||||||
try container.encodeModels(list, forKey: .list)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user