Paired down constraints. Made variables public. Mild formatting.
This commit is contained in:
parent
b443c4a389
commit
9b53f4bac0
@ -19,9 +19,9 @@
|
|||||||
// MARK: - Properties
|
// MARK: - Properties
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|
||||||
var sizeObject: MFSizeObject? = MFSizeObject(standardSize: Checkbox.defaultHeightWidth, standardiPadPortraitSize: Checkbox.defaultHeightWidth + 6.0)
|
public var sizeObject: MFSizeObject? = MFSizeObject(standardSize: Checkbox.defaultHeightWidth, standardiPadPortraitSize: Checkbox.defaultHeightWidth + 6.0)
|
||||||
|
|
||||||
var checkboxPosition: CheckboxPosition = .center
|
public var checkboxPosition: CheckboxPosition = .center
|
||||||
|
|
||||||
public enum CheckboxPosition: String {
|
public enum CheckboxPosition: String {
|
||||||
case center
|
case center
|
||||||
@ -33,10 +33,10 @@
|
|||||||
// MARK: - Constraints
|
// MARK: - Constraints
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|
||||||
var checkboxHeightConstraint: NSLayoutConstraint?
|
public var checkboxHeightConstraint: NSLayoutConstraint?
|
||||||
var checkboxTopConstraint: NSLayoutConstraint?
|
public var checkboxTopConstraint: NSLayoutConstraint?
|
||||||
var checkboxBottomConstraint: NSLayoutConstraint?
|
public var checkboxBottomConstraint: NSLayoutConstraint?
|
||||||
var checkboxCenterYConstraint: NSLayoutConstraint?
|
public var checkboxCenterYConstraint: NSLayoutConstraint?
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Life Cycle
|
// MARK: - Life Cycle
|
||||||
@ -81,12 +81,7 @@
|
|||||||
// MARK: - Initializers
|
// MARK: - Initializers
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|
||||||
required public init?(coder: NSCoder) {
|
public override init(frame: CGRect) {
|
||||||
super.init(coder: coder)
|
|
||||||
fatalError("xib file is not implemented for CheckboxWithLabelView")
|
|
||||||
}
|
|
||||||
|
|
||||||
override public init(frame: CGRect) {
|
|
||||||
super.init(frame: frame)
|
super.init(frame: frame)
|
||||||
setupView()
|
setupView()
|
||||||
}
|
}
|
||||||
@ -101,6 +96,11 @@
|
|||||||
alignCheckbox(position)
|
alignCheckbox(position)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
required public init?(coder: NSCoder) {
|
||||||
|
super.init(coder: coder)
|
||||||
|
fatalError("xib file is not implemented for CheckboxWithLabelView")
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Methods
|
// MARK: - Methods
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
@ -128,11 +128,11 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// MARK: - Molecular
|
// MARK: - Molecular
|
||||||
extension CheckboxWithLabelView {
|
extension CheckboxWithLabelView {
|
||||||
|
|
||||||
open class func estimatedHeight(forRow json: [AnyHashable: Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
open class func estimatedHeight(forRow json: [AnyHashable: Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
||||||
return CGFloat(Checkbox.defaultHeightWidth)
|
return 200
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc override open func updateView(_ size: CGFloat) {
|
@objc override open func updateView(_ size: CGFloat) {
|
||||||
@ -142,10 +142,6 @@ extension CheckboxWithLabelView {
|
|||||||
layoutIfNeeded()
|
layoutIfNeeded()
|
||||||
}
|
}
|
||||||
|
|
||||||
open func alignment() -> UIStackView.Alignment {
|
|
||||||
return .leading
|
|
||||||
}
|
|
||||||
|
|
||||||
open func resetConstraints() {
|
open func resetConstraints() {
|
||||||
|
|
||||||
checkboxCenterYConstraint?.isActive = false
|
checkboxCenterYConstraint?.isActive = false
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user