caretLink reload causing crash issue fixed
This commit is contained in:
parent
a641a3775b
commit
39ba2c9c84
@ -59,12 +59,6 @@ open class CaretLink: Button, MVMCoreUIViewConstrainingProtocol {
|
|||||||
// MARK: - Lifecycle
|
// MARK: - Lifecycle
|
||||||
//------------------------------------------------------
|
//------------------------------------------------------
|
||||||
|
|
||||||
override open func layoutSubviews() {
|
|
||||||
|
|
||||||
addCaretImageView()
|
|
||||||
super.layoutSubviews()
|
|
||||||
}
|
|
||||||
|
|
||||||
override public var isEnabled: Bool {
|
override public var isEnabled: Bool {
|
||||||
didSet { changeCaretColor() }
|
didSet { changeCaretColor() }
|
||||||
}
|
}
|
||||||
@ -135,7 +129,7 @@ open class CaretLink: Button, MVMCoreUIViewConstrainingProtocol {
|
|||||||
//------------------------------------------------------
|
//------------------------------------------------------
|
||||||
|
|
||||||
public override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
|
public override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
|
||||||
|
addCaretImageView()
|
||||||
guard let model = model as? CaretLinkModel else { return }
|
guard let model = model as? CaretLinkModel else { return }
|
||||||
|
|
||||||
if let color = model.backgroundColor {
|
if let color = model.backgroundColor {
|
||||||
@ -150,6 +144,11 @@ open class CaretLink: Button, MVMCoreUIViewConstrainingProtocol {
|
|||||||
setTitle(model.title, for: .normal)
|
setTitle(model.title, for: .normal)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
open override func reset() {
|
||||||
|
super.reset()
|
||||||
|
rightView?.removeFromSuperview()
|
||||||
|
}
|
||||||
|
|
||||||
public func needsToBeConstrained() -> Bool { true }
|
public func needsToBeConstrained() -> Bool { true }
|
||||||
|
|
||||||
open func horizontalAlignment() -> UIStackView.Alignment { .leading }
|
open func horizontalAlignment() -> UIStackView.Alignment { .leading }
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user