From 38c74acc6e86acbd8ea4e3631af9d4c1cd2ca2b4 Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Wed, 25 Sep 2019 14:43:29 -0400 Subject: [PATCH] moar. --- MVMCoreUI/Atoms/Views/Checkbox.swift | 8 +++---- .../Atoms/Views/CheckboxWithLabelView.swift | 23 +++---------------- 2 files changed, 7 insertions(+), 24 deletions(-) diff --git a/MVMCoreUI/Atoms/Views/Checkbox.swift b/MVMCoreUI/Atoms/Views/Checkbox.swift index 08f6227f..f29940f6 100644 --- a/MVMCoreUI/Atoms/Views/Checkbox.swift +++ b/MVMCoreUI/Atoms/Views/Checkbox.swift @@ -31,16 +31,16 @@ import MVMCore public var checkedColor: UIColor = .black public var unCheckedColor: UIColor = .mfPaleGrey() - public var hasRoundBorder = false + public var hasRoundCorners = false private var shapeLayer: CAShapeLayer? private var _lineColor: UIColor = .black private var _borderColor: UIColor = .black - private var _lineWidth: CGFloat = 1.0 - private var _cornerRadius: CGFloat = 5.0 + private var _lineWidth: CGFloat = 1 + private var _cornerRadius: CGFloat = 0 public func setCheckMarkLayer() { - checkedSquare.layer.cornerRadius = checkbox.isRoundRectCheckMark ? 5.0 : 0 + layer.cornerRadius = hasRoundCorners ? 5 : 0 } public var lineWidth: CGFloat { diff --git a/MVMCoreUI/Atoms/Views/CheckboxWithLabelView.swift b/MVMCoreUI/Atoms/Views/CheckboxWithLabelView.swift index 609937ee..62589b43 100644 --- a/MVMCoreUI/Atoms/Views/CheckboxWithLabelView.swift +++ b/MVMCoreUI/Atoms/Views/CheckboxWithLabelView.swift @@ -114,29 +114,14 @@ init(checkedColor: UIColor?, unCheck unCheckedColor: UIColor?, attributedText: NSAttributedString?) { super.init(frame: .zero) setup(withCheckedColor: checkedColor, unCheck: unCheckedColor, text: nil) - descriptionAttributedText = attributedText + setDescriptionAttributedText = attributedText addAccessibleProperties() } - init?(checkMarkView: MVMCoreUICheckMarkView?, checkedColor: UIColor?, unCheck unCheckedColor: UIColor?, text: String?) { - super.init(frame: .zero) - checkMark = checkMarkView - setup(withCheckedColor: checkedColor, unCheck: unCheckedColor, text: text) - addAccessibleProperties() - } - - init?(checkMarkView: MVMCoreUICheckMarkView?, checkedColor: UIColor?, unCheck unCheckedColor: UIColor?, attributedText: NSAttributedString?) { - super.init(frame: .zero) - checkMark = checkMarkView - setup(withCheckedColor: checkedColor, unCheck: unCheckedColor, text: nil) - descriptionAttributedText = attributedText - addAccessibleProperties() - } - - init(roundRect isRoundRect: Bool) { + init(hasRoundedCheckbox: Bool) { super.init(frame: .zero) - isRoundRectCheckMark = isRoundRect + checkbox.hasRoundBorder = hasRoundRectCheckbox setup(withCheckedColor: .white, unCheck: .white, text: nil) addAccessibleProperties() setCheckMarkLayer() @@ -262,8 +247,6 @@ extension CheckboxWithLabelView: FormValidationProtocol { public func formFieldValue() -> Any? { return NSNumber(value: checkbox.isSelected) } - - } // MARK:- Accessibility