check box
This commit is contained in:
parent
70c3da70d5
commit
f816081d8e
@ -88,7 +88,7 @@
|
||||
0ABD136D237CAD1E0081388D /* DateDropdownEntryField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0ABD136C237CAD1E0081388D /* DateDropdownEntryField.swift */; };
|
||||
0ABD1371237DB0450081388D /* ItemDropdownEntryField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0ABD1370237DB0450081388D /* ItemDropdownEntryField.swift */; };
|
||||
0AE14F64238315D2005417F8 /* TextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AE14F63238315D2005417F8 /* TextField.swift */; };
|
||||
31BE15CB23D8924D00452370 /* CheckboxWithLabelViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31BE15C923D8924C00452370 /* CheckboxWithLabelViewModel.swift */; };
|
||||
31BE15CB23D8924D00452370 /* CheckboxLabelModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31BE15C923D8924C00452370 /* CheckboxLabelModel.swift */; };
|
||||
31BE15CC23D8924D00452370 /* CheckboxModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31BE15CA23D8924C00452370 /* CheckboxModel.swift */; };
|
||||
943784F5236B77BB006A1E82 /* GraphView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 943784F3236B77BB006A1E82 /* GraphView.swift */; };
|
||||
943784F6236B77BB006A1E82 /* GraphViewAnimationHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 943784F4236B77BB006A1E82 /* GraphViewAnimationHandler.swift */; };
|
||||
@ -384,7 +384,7 @@
|
||||
0ABD136C237CAD1E0081388D /* DateDropdownEntryField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DateDropdownEntryField.swift; sourceTree = "<group>"; };
|
||||
0ABD1370237DB0450081388D /* ItemDropdownEntryField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ItemDropdownEntryField.swift; sourceTree = "<group>"; };
|
||||
0AE14F63238315D2005417F8 /* TextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextField.swift; sourceTree = "<group>"; };
|
||||
31BE15C923D8924C00452370 /* CheckboxWithLabelViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CheckboxWithLabelViewModel.swift; sourceTree = "<group>"; };
|
||||
31BE15C923D8924C00452370 /* CheckboxLabelModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CheckboxLabelModel.swift; sourceTree = "<group>"; };
|
||||
31BE15CA23D8924C00452370 /* CheckboxModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CheckboxModel.swift; sourceTree = "<group>"; };
|
||||
9402C34F23A2CEA3004B974C /* LeftRightLabelModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LeftRightLabelModel.swift; sourceTree = "<group>"; };
|
||||
943784F3236B77BB006A1E82 /* GraphView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GraphView.swift; sourceTree = "<group>"; };
|
||||
@ -1149,7 +1149,7 @@
|
||||
0A7BAFA0232BE61800FB8E22 /* Checkbox.swift */,
|
||||
31BE15CA23D8924C00452370 /* CheckboxModel.swift */,
|
||||
0A7BAFA2232BE63400FB8E22 /* CheckboxWithLabelView.swift */,
|
||||
31BE15C923D8924C00452370 /* CheckboxWithLabelViewModel.swift */,
|
||||
31BE15C923D8924C00452370 /* CheckboxLabelModel.swift */,
|
||||
01004F2F22721C3800991ECC /* RadioButton.swift */,
|
||||
D28A838223CCBD3F00DFE4FC /* CircleProgressModel.swift */,
|
||||
943784F3236B77BB006A1E82 /* GraphView.swift */,
|
||||
@ -1562,7 +1562,7 @@
|
||||
DBEFFA04225A829700230692 /* Label.swift in Sources */,
|
||||
D2D6CD4022E78C1A00D701B8 /* Scroller.swift in Sources */,
|
||||
01509D952327ED1900EF99AA /* HeadlineBodyTextButtonSwitch.swift in Sources */,
|
||||
31BE15CB23D8924D00452370 /* CheckboxWithLabelViewModel.swift in Sources */,
|
||||
31BE15CB23D8924D00452370 /* CheckboxLabelModel.swift in Sources */,
|
||||
D260105523CEA7DC00764D80 /* MVMCoreUISwitch+Model.swift in Sources */,
|
||||
D29DF13021E6851E003B2FB9 /* MVMCoreUITopAlertShortView.m in Sources */,
|
||||
0ABD136D237CAD1E0081388D /* DateDropdownEntryField.swift in Sources */,
|
||||
|
||||
@ -485,14 +485,14 @@ import MVMCore
|
||||
layer.borderWidth = borderWidth
|
||||
}
|
||||
|
||||
if let isChecked = checkboxModel.isChecked, isChecked {
|
||||
if checkboxModel.isChecked {
|
||||
updateSelectionOnly = true
|
||||
isSelected = isChecked
|
||||
isSelected = checkboxModel.isChecked
|
||||
updateSelectionOnly = false
|
||||
}
|
||||
|
||||
if let checkColorHex = checkboxModel.checkColor {
|
||||
checkColor = UIColor.mfGet(forHex: checkColorHex)
|
||||
if let uiCheckColor = checkboxModel.checkColor?.uiColor {
|
||||
checkColor = uiCheckColor
|
||||
}
|
||||
|
||||
if let unCheckedBackgroundColorHex = checkboxModel.unCheckedBackgroundColor {
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
@objcMembers public class CheckboxWithLabelViewModel: MoleculeModelProtocol {
|
||||
@objcMembers public class CheckboxLabelModel: MoleculeModelProtocol {
|
||||
public static var identifier: String = "checkboxLabel"
|
||||
public var backgroundColor: Color?
|
||||
|
||||
@ -18,8 +18,8 @@ import Foundation
|
||||
public var required: Bool?
|
||||
public var borderColor: String?
|
||||
public var borderWidth: CGFloat?
|
||||
public var isChecked: Bool?
|
||||
public var checkColor: String?
|
||||
public var isChecked: Bool = false
|
||||
public var checkColor: Color?
|
||||
public var unCheckedBackgroundColor: String?
|
||||
public var checkedBackgroundColor: String?
|
||||
public var isAnimated: Bool?
|
||||
@ -53,8 +53,8 @@ import Foundation
|
||||
self.required = try typeContainer.decodeIfPresent(Bool.self, forKey: .required)
|
||||
self.borderColor = try typeContainer.decodeIfPresent(String.self, forKey: .borderColor)
|
||||
self.borderWidth = try typeContainer.decodeIfPresent(CGFloat.self, forKey: .borderWidth)
|
||||
self.isChecked = try typeContainer.decodeIfPresent(Bool.self, forKey: .isChecked)
|
||||
self.checkColor = try typeContainer.decodeIfPresent(String.self, forKey: .checkColor)
|
||||
self.isChecked = try typeContainer.decodeIfPresent(Bool.self, forKey: .isChecked) ?? false
|
||||
self.checkColor = try typeContainer.decodeIfPresent(Color.self, forKey: .checkColor)
|
||||
self.unCheckedBackgroundColor = try typeContainer.decodeIfPresent(String.self, forKey: .unCheckedBackgroundColor)
|
||||
self.checkedBackgroundColor = try typeContainer.decodeIfPresent(String.self, forKey: .checkedBackgroundColor)
|
||||
self.isAnimated = try typeContainer.decodeIfPresent(Bool.self, forKey: .isAnimated)
|
||||
|
||||
@ -122,7 +122,7 @@
|
||||
}
|
||||
|
||||
open override func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
|
||||
guard let checkBoxWithLabelModel = model as? CheckboxWithLabelViewModel else {
|
||||
guard let checkBoxWithLabelModel = model as? CheckboxLabelModel else {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@ -74,6 +74,6 @@ import Foundation
|
||||
|
||||
//Checkbox
|
||||
ModelRegistry.register(CheckboxModel.self)
|
||||
ModelRegistry.register(CheckboxWithLabelViewModel.self)
|
||||
ModelRegistry.register(CheckboxLabelModel.self)
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user