caretLink reload causing crash issue fixed

This commit is contained in:
Tondapu, Alekhya 2021-05-13 23:19:53 +05:30
parent a641a3775b
commit 39ba2c9c84

View File

@ -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 }