Brought back resizing to checkbox.
This commit is contained in:
parent
9b53f4bac0
commit
aaa8e4132e
@ -16,6 +16,8 @@ import MVMCore
|
|||||||
// MARK: - Properties
|
// MARK: - Properties
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|
||||||
|
public var sizeObject: MFSizeObject? = MFSizeObject(standardSize: Checkbox.defaultHeightWidth, standardiPadPortraitSize: Checkbox.defaultHeightWidth + 6.0)
|
||||||
|
|
||||||
// Form Validation
|
// Form Validation
|
||||||
var isRequired = false
|
var isRequired = false
|
||||||
var fieldKey: String?
|
var fieldKey: String?
|
||||||
@ -117,8 +119,8 @@ import MVMCore
|
|||||||
// MARK: - Constraints
|
// MARK: - Constraints
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|
||||||
private var heightConstraint: NSLayoutConstraint?
|
public var heightConstraint: NSLayoutConstraint?
|
||||||
private var widthConstraint: NSLayoutConstraint?
|
public var widthConstraint: NSLayoutConstraint?
|
||||||
|
|
||||||
/// Updates the height and width anchors of the Checkbox with the assigned value.
|
/// Updates the height and width anchors of the Checkbox with the assigned value.
|
||||||
public var heigthWidthConstant: CGFloat = Checkbox.defaultHeightWidth {
|
public var heigthWidthConstant: CGFloat = Checkbox.defaultHeightWidth {
|
||||||
@ -398,6 +400,11 @@ import MVMCore
|
|||||||
|
|
||||||
public func updateView(_ size: CGFloat) {
|
public func updateView(_ size: CGFloat) {
|
||||||
|
|
||||||
|
if let dimension = sizeObject?.getValueBased(onSize: size) {
|
||||||
|
widthConstraint?.constant = dimension
|
||||||
|
heightConstraint?.constant = dimension
|
||||||
|
}
|
||||||
|
|
||||||
layoutIfNeeded()
|
layoutIfNeeded()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -19,8 +19,6 @@
|
|||||||
// MARK: - Properties
|
// MARK: - Properties
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|
||||||
public var sizeObject: MFSizeObject? = MFSizeObject(standardSize: Checkbox.defaultHeightWidth, standardiPadPortraitSize: Checkbox.defaultHeightWidth + 6.0)
|
|
||||||
|
|
||||||
public var checkboxPosition: CheckboxPosition = .center
|
public var checkboxPosition: CheckboxPosition = .center
|
||||||
|
|
||||||
public enum CheckboxPosition: String {
|
public enum CheckboxPosition: String {
|
||||||
@ -139,6 +137,7 @@ extension CheckboxWithLabelView {
|
|||||||
super.updateView(size)
|
super.updateView(size)
|
||||||
|
|
||||||
label.updateView(size)
|
label.updateView(size)
|
||||||
|
checkbox.updateView(size)
|
||||||
layoutIfNeeded()
|
layoutIfNeeded()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user