diff --git a/MVMCoreUI/Atomic/Atoms/Buttons/CaretLink.swift b/MVMCoreUI/Atomic/Atoms/Buttons/CaretLink.swift index 5ae68241..caa356cf 100644 --- a/MVMCoreUI/Atomic/Atoms/Buttons/CaretLink.swift +++ b/MVMCoreUI/Atomic/Atoms/Buttons/CaretLink.swift @@ -59,12 +59,6 @@ open class CaretLink: Button, MVMCoreUIViewConstrainingProtocol { // MARK: - Lifecycle //------------------------------------------------------ - override open func layoutSubviews() { - - addCaretImageView() - super.layoutSubviews() - } - override public var isEnabled: Bool { didSet { changeCaretColor() } } @@ -135,7 +129,7 @@ open class CaretLink: Button, MVMCoreUIViewConstrainingProtocol { //------------------------------------------------------ public override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) { - + addCaretImageView() guard let model = model as? CaretLinkModel else { return } if let color = model.backgroundColor { @@ -150,6 +144,11 @@ open class CaretLink: Button, MVMCoreUIViewConstrainingProtocol { setTitle(model.title, for: .normal) } + open override func reset() { + super.reset() + rightView?.removeFromSuperview() + } + public func needsToBeConstrained() -> Bool { true } open func horizontalAlignment() -> UIStackView.Alignment { .leading }