diff --git a/MVMCoreUI/Atoms/Views/CheckboxWithLabelView.swift b/MVMCoreUI/Atoms/Views/CheckboxWithLabelView.swift index bf0288ae..40b91f87 100644 --- a/MVMCoreUI/Atoms/Views/CheckboxWithLabelView.swift +++ b/MVMCoreUI/Atoms/Views/CheckboxWithLabelView.swift @@ -72,15 +72,6 @@ checkboxHeightConstraint?.isActive = true alignSubviews(by: .centerLeft) - - label.isUserInteractionEnabled = true - let tap = UITapGestureRecognizer(target: self, action: #selector(tapped)) - tap.numberOfTapsRequired = 1 - label.addGestureRecognizer(tap) - } - - @objc func tapped() { - checkbox.updateSelection(to: !checkbox.isSelected, animated: true) } //-------------------------------------------------- @@ -104,25 +95,10 @@ public convenience init(position: CheckboxPosition) { self.init(frame: .zero) + toggleSubviewConstraints(isActive: false) alignSubviews(by: position) } - public convenience init(checkedColor: UIColor, unCheckedColor: UIColor, text: String?, isChecked: Bool = false) { - self.init(frame: .zero) - - checkbox.checkedBackgroundColor = checkedColor - checkbox.unCheckedBackgroundColor = unCheckedColor - label.text = text - } - - public convenience init(checkedColor: UIColor, unCheck unCheckedColor: UIColor, attributedText: NSAttributedString, isChecked: Bool = false) { - self.init(frame: .zero) - - checkbox.checkedBackgroundColor = checkedColor - checkbox.unCheckedBackgroundColor = unCheckedColor - label.attributedText = attributedText - } - //-------------------------------------------------- // MARK: - Methods //-------------------------------------------------- @@ -211,6 +187,7 @@ extension CheckboxWithLabelView { } @objc override open func updateView(_ size: CGFloat) { + super.updateView(size) label.updateView(size)