remove methods
This commit is contained in:
parent
50f573688f
commit
7c70b0a4a1
@ -9,6 +9,7 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
public enum CheckboxPosition: String, Codable {
|
public enum CheckboxPosition: String, Codable {
|
||||||
|
case left
|
||||||
case center
|
case center
|
||||||
case top
|
case top
|
||||||
case bottom
|
case bottom
|
||||||
@ -21,24 +22,4 @@ public enum CheckboxPosition: String, Codable {
|
|||||||
public var checkboxAlignment: CheckboxPosition?
|
public var checkboxAlignment: CheckboxPosition?
|
||||||
public var checkbox: CheckboxModel
|
public var checkbox: CheckboxModel
|
||||||
public var label: LabelModel
|
public var label: LabelModel
|
||||||
|
|
||||||
enum CodingKeys: String, CodingKey {
|
|
||||||
case checkboxAlignment
|
|
||||||
case checkbox
|
|
||||||
case label
|
|
||||||
}
|
|
||||||
|
|
||||||
required public init(from decoder: Decoder) throws {
|
|
||||||
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
|
||||||
self.checkboxAlignment = try typeContainer.decodeIfPresent(CheckboxPosition.self, forKey: .checkboxAlignment)
|
|
||||||
self.checkbox = try typeContainer.decode(CheckboxModel.self, forKey: .checkbox)
|
|
||||||
self.label = try typeContainer.decode(LabelModel.self, forKey: .label)
|
|
||||||
}
|
|
||||||
|
|
||||||
public func encode(to encoder: Encoder) throws {
|
|
||||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
||||||
try container.encodeIfPresent(checkboxAlignment, forKey: .checkboxAlignment)
|
|
||||||
try container.encode(checkbox, forKey: .checkbox)
|
|
||||||
try container.encode(label, forKey: .label)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user