Changes as per review comments - Default 'numberOfLines' for all Designed components
This commit is contained in:
parent
921df032b2
commit
f09892b4c6
@ -48,11 +48,8 @@ import Foundation
|
|||||||
open override func setupView() {
|
open override func setupView() {
|
||||||
super.setupView()
|
super.setupView()
|
||||||
setDefaults()
|
setDefaults()
|
||||||
body.numberOfLines = 1
|
|
||||||
body.lineBreakMode = .byTruncatingTail
|
body.lineBreakMode = .byTruncatingTail
|
||||||
body2.numberOfLines = 1
|
|
||||||
body2.lineBreakMode = .byTruncatingTail
|
body2.lineBreakMode = .byTruncatingTail
|
||||||
body3.numberOfLines = 1
|
|
||||||
body3.lineBreakMode = .byTruncatingTail
|
body3.lineBreakMode = .byTruncatingTail
|
||||||
|
|
||||||
verticalLine1.widthConstraint?.isActive = true
|
verticalLine1.widthConstraint?.isActive = true
|
||||||
|
|||||||
@ -21,6 +21,23 @@ public class HeadersH2PricingTwoRowsModel: HeaderModel, MoleculeModelProtocol {
|
|||||||
public var body3: LabelModel
|
public var body3: LabelModel
|
||||||
public var subBody3: LabelModel?
|
public var subBody3: LabelModel?
|
||||||
|
|
||||||
|
//-----------------------------------------------------
|
||||||
|
// MARK: - Methods
|
||||||
|
//-----------------------------------------------------
|
||||||
|
|
||||||
|
override public func setDefaults() {
|
||||||
|
super.setDefaults()
|
||||||
|
if body.numberOfLines == nil {
|
||||||
|
body.numberOfLines = 1
|
||||||
|
}
|
||||||
|
if body2.numberOfLines == nil {
|
||||||
|
body2.numberOfLines = 1
|
||||||
|
}
|
||||||
|
if body3.numberOfLines == nil {
|
||||||
|
body3.numberOfLines = 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Initializer
|
// MARK: - Initializer
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|||||||
@ -50,7 +50,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()
|
||||||
}
|
}
|
||||||
|
|||||||
@ -31,6 +31,10 @@ public class ListLeftVariableIconWithRightCaretAllTextLinksModel: ListItemModel,
|
|||||||
image.width = 30
|
image.width = 30
|
||||||
image.height = 30
|
image.height = 30
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if rightLabel.numberOfLines == nil {
|
||||||
|
rightLabel.numberOfLines = 1
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
|
|||||||
@ -71,7 +71,6 @@
|
|||||||
rightBar.widthAnchor.constraint(equalToConstant: 20).isActive = true
|
rightBar.widthAnchor.constraint(equalToConstant: 20).isActive = true
|
||||||
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()
|
||||||
horizontalStack.restack()
|
horizontalStack.restack()
|
||||||
|
|||||||
@ -45,6 +45,10 @@ public class ListProgressBarThinModel: ListItemModel, MoleculeModelProtocol {
|
|||||||
rightBar.backgroundColor = Color(uiColor: .gray)
|
rightBar.backgroundColor = Color(uiColor: .gray)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if rightLabel.numberOfLines == nil {
|
||||||
|
rightLabel.numberOfLines = 1
|
||||||
|
}
|
||||||
|
|
||||||
leftHeadline.hero = 0
|
leftHeadline.hero = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -39,7 +39,6 @@
|
|||||||
|
|
||||||
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()
|
||||||
horizontalStack.restack()
|
horizontalStack.restack()
|
||||||
|
|||||||
@ -18,6 +18,17 @@ public class ListStoreLocatorModel: ListItemModel, MoleculeModelProtocol {
|
|||||||
public var leftSubBody: LabelModel
|
public var leftSubBody: LabelModel
|
||||||
public var rightLabel: LabelModel
|
public var rightLabel: LabelModel
|
||||||
|
|
||||||
|
//-----------------------------------------------------
|
||||||
|
// MARK: - Methods
|
||||||
|
//-----------------------------------------------------
|
||||||
|
|
||||||
|
override public func setDefaults() {
|
||||||
|
super.setDefaults()
|
||||||
|
if rightLabel.numberOfLines == nil {
|
||||||
|
rightLabel.numberOfLines = 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Initializer
|
// MARK: - Initializer
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|||||||
@ -61,7 +61,6 @@
|
|||||||
|
|
||||||
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()
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,6 +17,17 @@ public class ListRightVariablePriceChangeAllTextAndLinksModel: ListItemModel, Mo
|
|||||||
public var rightLabel: LabelModel
|
public var rightLabel: LabelModel
|
||||||
public var arrow: ArrowModel
|
public var arrow: ArrowModel
|
||||||
|
|
||||||
|
//-----------------------------------------------------
|
||||||
|
// MARK: - Methods
|
||||||
|
//-----------------------------------------------------
|
||||||
|
|
||||||
|
override public func setDefaults() {
|
||||||
|
super.setDefaults()
|
||||||
|
if rightLabel.numberOfLines == nil {
|
||||||
|
rightLabel.numberOfLines = 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Initializer
|
// MARK: - Initializer
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|||||||
@ -46,7 +46,6 @@
|
|||||||
|
|
||||||
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()
|
||||||
|
|||||||
@ -37,6 +37,9 @@ public class ListRightVariablePriceChangeBodyTextModel: ListItemModel, MoleculeM
|
|||||||
if let headline = headlineBody.headline {
|
if let headline = headlineBody.headline {
|
||||||
headline.hero = 0
|
headline.hero = 0
|
||||||
}
|
}
|
||||||
|
if rightLabel.numberOfLines == nil {
|
||||||
|
rightLabel.numberOfLines = 1
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|||||||
@ -38,7 +38,6 @@
|
|||||||
super.setupView()
|
super.setupView()
|
||||||
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()
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,6 +16,17 @@ public class ListRightVariableRightCaretAllTextAndLinksModel: ListItemModel, Mol
|
|||||||
public var rightLabel: LabelModel
|
public var rightLabel: LabelModel
|
||||||
public var eyebrowHeadlineBodyLink: EyebrowHeadlineBodyLinkModel
|
public var eyebrowHeadlineBodyLink: EyebrowHeadlineBodyLinkModel
|
||||||
|
|
||||||
|
//-----------------------------------------------------
|
||||||
|
// MARK: - Methods
|
||||||
|
//-----------------------------------------------------
|
||||||
|
|
||||||
|
override public func setDefaults() {
|
||||||
|
super.setDefaults()
|
||||||
|
if rightLabel.numberOfLines == nil {
|
||||||
|
rightLabel.numberOfLines = 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Initializer
|
// MARK: - Initializer
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|||||||
@ -39,9 +39,6 @@
|
|||||||
|
|
||||||
open override func setupView() {
|
open override func setupView() {
|
||||||
super.setupView()
|
super.setupView()
|
||||||
leftLabel.numberOfLines = 1
|
|
||||||
centerLabel.numberOfLines = 1
|
|
||||||
rightLabel.numberOfLines = 1
|
|
||||||
addMolecule(stack)
|
addMolecule(stack)
|
||||||
stack.restack()
|
stack.restack()
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,6 +17,23 @@ public class ListThreeColumnBillChangesModel: ListItemModel, MoleculeModelProtoc
|
|||||||
public var centerLabel: LabelModel
|
public var centerLabel: LabelModel
|
||||||
public var rightLabel: LabelModel
|
public var rightLabel: LabelModel
|
||||||
|
|
||||||
|
//-----------------------------------------------------
|
||||||
|
// MARK: - Methods
|
||||||
|
//-----------------------------------------------------
|
||||||
|
|
||||||
|
override public func setDefaults() {
|
||||||
|
super.setDefaults()
|
||||||
|
if rightLabel.numberOfLines == nil {
|
||||||
|
rightLabel.numberOfLines = 1
|
||||||
|
}
|
||||||
|
if centerLabel.numberOfLines == nil {
|
||||||
|
centerLabel.numberOfLines = 1
|
||||||
|
}
|
||||||
|
if leftLabel.numberOfLines == nil {
|
||||||
|
leftLabel.numberOfLines = 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Initializer
|
// MARK: - Initializer
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|||||||
@ -74,9 +74,6 @@
|
|||||||
view.addSubview(rightVerticalStack)
|
view.addSubview(rightVerticalStack)
|
||||||
NSLayoutConstraint.pinViews(leftView: leftVerticalStack, rightView: rightVerticalStack, alignTop: true)
|
NSLayoutConstraint.pinViews(leftView: leftVerticalStack, rightView: rightVerticalStack, alignTop: true)
|
||||||
|
|
||||||
leftHeadline.numberOfLines = 1
|
|
||||||
rightLabel.numberOfLines = 1
|
|
||||||
rightSubLabel.numberOfLines = 1
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------
|
//----------------------------------------------------
|
||||||
|
|||||||
@ -34,6 +34,18 @@ public class ListTwoColumnPriceDescriptionModel: ListItemModel, MoleculeModelPro
|
|||||||
if rightSubLabel.attributes == nil {
|
if rightSubLabel.attributes == nil {
|
||||||
rightSubLabel.attributes = [LabelAttributeStrikeThroughModel(0, rightSubLabel.text.count)]
|
rightSubLabel.attributes = [LabelAttributeStrikeThroughModel(0, rightSubLabel.text.count)]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if rightLabel.numberOfLines == nil {
|
||||||
|
rightLabel.numberOfLines = 1
|
||||||
|
}
|
||||||
|
|
||||||
|
if rightSubLabel.numberOfLines == nil {
|
||||||
|
rightSubLabel.numberOfLines = 1
|
||||||
|
}
|
||||||
|
|
||||||
|
if leftHeadline.numberOfLines == nil {
|
||||||
|
leftHeadline.numberOfLines = 1
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user