Changes as per review comments
This commit is contained in:
parent
bba4cbfb66
commit
921df032b2
@ -316,8 +316,8 @@ public typealias ActionBlock = () -> ()
|
|||||||
textColor = color.uiColor
|
textColor = color.uiColor
|
||||||
}
|
}
|
||||||
|
|
||||||
if let numberofLines = labelModel.numberOfLines {
|
if let lines = labelModel.numberOfLines {
|
||||||
numberOfLines = numberofLines
|
numberOfLines = lines
|
||||||
}
|
}
|
||||||
|
|
||||||
if let attributes = labelModel.attributes, let labelText = text {
|
if let attributes = labelModel.attributes, let labelText = text {
|
||||||
@ -794,6 +794,7 @@ extension Label {
|
|||||||
accessibilityCustomActions = []
|
accessibilityCustomActions = []
|
||||||
clauses = []
|
clauses = []
|
||||||
accessibilityTraits = .staticText
|
accessibilityTraits = .staticText
|
||||||
|
numberOfLines = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
public func needsToBeConstrained() -> Bool { true }
|
public func needsToBeConstrained() -> Bool { true }
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
public var html: String?
|
public var html: String?
|
||||||
public var hero: Int?
|
public var hero: Int?
|
||||||
public var makeWholeViewClickable: Bool?
|
public var makeWholeViewClickable: Bool?
|
||||||
public var numberOfLines:Int?
|
public var numberOfLines: Int?
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Keys
|
// MARK: - Keys
|
||||||
@ -52,23 +52,12 @@
|
|||||||
case type
|
case type
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------
|
|
||||||
// MARK: - Methods
|
|
||||||
//-----------------------------------------------------
|
|
||||||
|
|
||||||
internal func setDefaults() {
|
|
||||||
if numberOfLines == nil {
|
|
||||||
numberOfLines = 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Initializer
|
// MARK: - Initializer
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|
||||||
public init(text: String) {
|
public init(text: String) {
|
||||||
self.text = text
|
self.text = text
|
||||||
setDefaults()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|||||||
@ -55,7 +55,6 @@
|
|||||||
leftImage.contentMode = .scaleAspectFit
|
leftImage.contentMode = .scaleAspectFit
|
||||||
rightLabel.setContentCompressionResistancePriority(UILayoutPriority(rawValue: 900), for: .horizontal)
|
rightLabel.setContentCompressionResistancePriority(UILayoutPriority(rawValue: 900), for: .horizontal)
|
||||||
rightLabel.setContentHuggingPriority(UILayoutPriority(rawValue: 900), for: .horizontal)
|
rightLabel.setContentHuggingPriority(UILayoutPriority(rawValue: 900), for: .horizontal)
|
||||||
rightLabel.numberOfLines = 1
|
|
||||||
addMolecule(stack)
|
addMolecule(stack)
|
||||||
stack.restack()
|
stack.restack()
|
||||||
}
|
}
|
||||||
@ -73,9 +72,6 @@
|
|||||||
headlineBody.set(with: model.headlineBody, delegateObject, additionalData)
|
headlineBody.set(with: model.headlineBody, delegateObject, additionalData)
|
||||||
rightLabel.set(with: model.rightLabel, delegateObject, additionalData)
|
rightLabel.set(with: model.rightLabel, delegateObject, additionalData)
|
||||||
updateAccessibilityLabel()
|
updateAccessibilityLabel()
|
||||||
if let numberOfLines = model.rightLabel.numberOfLines{
|
|
||||||
rightLabel.numberOfLines = numberOfLines
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
|
open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
|
||||||
|
|||||||
@ -29,6 +29,9 @@ public class ListLeftVariableIconWithRightCaretBodyTextModel: ListItemModel, Mol
|
|||||||
}
|
}
|
||||||
headlineBody.style = .item
|
headlineBody.style = .item
|
||||||
headlineBody.headline?.hero = 0
|
headlineBody.headline?.hero = 0
|
||||||
|
if rightLabel.numberOfLines == nil {
|
||||||
|
rightLabel.numberOfLines = 1
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user