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