position
This commit is contained in:
parent
61edfcc747
commit
50f573688f
@ -8,11 +8,17 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public enum CheckboxPosition: String, Codable {
|
||||
case center
|
||||
case top
|
||||
case bottom
|
||||
}
|
||||
|
||||
@objcMembers public class CheckboxLabelModel: MoleculeModelProtocol {
|
||||
public static var identifier: String = "checkboxLabel"
|
||||
public var backgroundColor: Color?
|
||||
|
||||
public var checkboxAlignment: String?
|
||||
public var checkboxAlignment: CheckboxPosition?
|
||||
public var checkbox: CheckboxModel
|
||||
public var label: LabelModel
|
||||
|
||||
@ -24,7 +30,7 @@ import Foundation
|
||||
|
||||
required public init(from decoder: Decoder) throws {
|
||||
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
||||
self.checkboxAlignment = try typeContainer.decodeIfPresent(String.self, forKey: .checkboxAlignment)
|
||||
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)
|
||||
}
|
||||
|
||||
@ -21,12 +21,6 @@
|
||||
|
||||
public var checkboxPosition: CheckboxPosition = .center
|
||||
|
||||
public enum CheckboxPosition: String {
|
||||
case center
|
||||
case top
|
||||
case bottom
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Constraints
|
||||
//--------------------------------------------------
|
||||
@ -126,8 +120,8 @@
|
||||
return
|
||||
}
|
||||
|
||||
if let checkboxAlignment = checkBoxWithLabelModel.checkboxAlignment, let position = CheckboxPosition(rawValue: checkboxAlignment) {
|
||||
alignCheckbox(position)
|
||||
if let checkboxAlignment = checkBoxWithLabelModel.checkboxAlignment {
|
||||
alignCheckbox(checkboxAlignment)
|
||||
}
|
||||
|
||||
checkbox.setWithModel(checkBoxWithLabelModel.checkbox, delegateObject, additionalData)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user