Merge branch 'feature/caretLink' into 'develop'

caretLink reload causing crash issue fixed

See merge request BPHV_MIPS/mvm_core_ui!718
This commit is contained in:
Pfeil, Scott Robert 2021-05-13 14:09:35 -04:00
commit c025c9ec16

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 }