update link
This commit is contained in:
parent
b24745fd89
commit
01780e708f
@ -30,25 +30,7 @@ import UIKit
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|
||||||
private var delegateObject: MVMCoreUIDelegateObject?
|
private var delegateObject: MVMCoreUIDelegateObject?
|
||||||
|
|
||||||
//--------------------------------------------------
|
|
||||||
// MARK: - Initializers
|
|
||||||
//--------------------------------------------------
|
|
||||||
|
|
||||||
public override init(frame: CGRect) {
|
|
||||||
super.init(frame: frame)
|
|
||||||
setupView()
|
|
||||||
}
|
|
||||||
|
|
||||||
public convenience init() {
|
|
||||||
self.init(frame: .zero)
|
|
||||||
}
|
|
||||||
|
|
||||||
public required init?(coder: NSCoder) {
|
|
||||||
super.init(coder: coder)
|
|
||||||
setupView()
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Lifecycle
|
// MARK: - Lifecycle
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
@ -95,8 +77,7 @@ extension Link {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public override func setupView() {
|
public override func setupView() {
|
||||||
|
super.setupView()
|
||||||
translatesAutoresizingMaskIntoConstraints = false
|
|
||||||
backgroundColor = .clear
|
backgroundColor = .clear
|
||||||
contentMode = .redraw
|
contentMode = .redraw
|
||||||
setTitleColor(.mfTextButton(), for: .normal)
|
setTitleColor(.mfTextButton(), for: .normal)
|
||||||
@ -118,17 +99,17 @@ extension Link: ModelMoleculeViewProtocol {
|
|||||||
backgroundColor = model.backgroundColor?.uiColor
|
backgroundColor = model.backgroundColor?.uiColor
|
||||||
set(with: model.action, delegateObject: delegateObject, additionalData: additionalData)
|
set(with: model.action, delegateObject: delegateObject, additionalData: additionalData)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static func estimatedHeight(forRow molecule: MoleculeProtocol?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
|
||||||
|
return 31.0
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// MARK: - MVMCoreUIMoleculeViewProtocol
|
// MARK: - MVMCoreUIMoleculeViewProtocol
|
||||||
extension Link {
|
extension Link {
|
||||||
|
|
||||||
public override func reset() {
|
|
||||||
super.reset()
|
|
||||||
setTitleColor(.mfTextButton(), for: .normal)
|
|
||||||
}
|
|
||||||
|
|
||||||
public override func setWithJSON(_ json: [AnyHashable: Any]?, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) {
|
public override func setWithJSON(_ json: [AnyHashable: Any]?, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) {
|
||||||
super.setWithJSON(json, delegateObject: delegateObject, additionalData: additionalData)
|
super.setWithJSON(json, delegateObject: delegateObject, additionalData: additionalData)
|
||||||
self.additionalData = additionalData
|
self.additionalData = additionalData
|
||||||
@ -164,10 +145,6 @@ extension Link {
|
|||||||
// MARK: - MVMCoreUIViewConstrainingProtocol
|
// MARK: - MVMCoreUIViewConstrainingProtocol
|
||||||
extension Link: MVMCoreUIViewConstrainingProtocol {
|
extension Link: MVMCoreUIViewConstrainingProtocol {
|
||||||
|
|
||||||
public func needsToBeConstrained() -> Bool {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
public func alignment() -> UIStackView.Alignment {
|
public func alignment() -> UIStackView.Alignment {
|
||||||
return .leading
|
return .leading
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user