updated model

This commit is contained in:
Murugan, Vimal 2020-01-14 00:11:41 +05:30
parent b4859988c2
commit e6079eab55
2 changed files with 0 additions and 32 deletions

View File

@ -12,20 +12,6 @@ import Foundation
public var backgroundColor: String?
public static var identifier: String = "numberedList"
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 {

View File

@ -9,26 +9,8 @@
import Foundation
@objcMembers public class UnOrderedListModel: OrderListProtocol {
public var backgroundColor: String?
public static var identifier: String = "unOrderedList"
public var bulletChar: String?
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)
}
}