udpated to fix bug in resetting
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
7819cd8646
commit
3db7cf0a42
@ -41,7 +41,7 @@ extension TitleLockup {
|
||||
subTitleModel = TitleLockupSubTitleModel(text: model.text, textColor: model.textColor, textAttributes: model.textAttributes)
|
||||
otherTypograpicalStyle = model.typographicalStyle.value
|
||||
} else {
|
||||
reset()
|
||||
subTitleModel = nil
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -39,7 +39,7 @@ extension TitleLockup {
|
||||
if let model, !model.text.isEmpty {
|
||||
titleModel = TitleLockupTitleModel(text: model.text, textAttributes: model.textAttributes, typographicalStyle: model.typographicalStyle.value)
|
||||
} else {
|
||||
reset()
|
||||
titleModel = nil
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -254,8 +254,10 @@ open class TitleLockup: View {
|
||||
eyebrowLabel.attributes = eyebrowModel.textAttributes
|
||||
eyebrowLabel.numberOfLines = eyebrowModel.numberOfLines
|
||||
eyebrowLabel.surface = surface
|
||||
} else {
|
||||
eyebrowLabel.reset()
|
||||
}
|
||||
|
||||
|
||||
if let titleModel, !titleModel.text.isEmpty {
|
||||
titleTextIsEmpty = false
|
||||
titleLabel.textPosition = allLabelsTextPosition
|
||||
@ -264,6 +266,8 @@ open class TitleLockup: View {
|
||||
titleLabel.attributes = titleModel.textAttributes
|
||||
titleLabel.numberOfLines = titleModel.numberOfLines
|
||||
titleLabel.surface = surface
|
||||
} else {
|
||||
titleLabel.reset()
|
||||
}
|
||||
|
||||
if let subTitleModel, !subTitleModel.text.isEmpty {
|
||||
@ -275,6 +279,8 @@ open class TitleLockup: View {
|
||||
subTitleLabel.numberOfLines = subTitleModel.numberOfLines
|
||||
subTitleLabel.surface = surface
|
||||
subTitleLabel.disabled = subTitleModel.textColor == .secondary
|
||||
} else {
|
||||
subTitleLabel.reset()
|
||||
}
|
||||
|
||||
//if both first 2 rows not empty set spacing
|
||||
@ -291,6 +297,11 @@ open class TitleLockup: View {
|
||||
} else if (!eyebrowTextIsEmpty || !titleTextIsEmpty) && subTitleTextIsEmpty {
|
||||
stackView.setCustomSpacing(0.0, after: titleLabel)
|
||||
}
|
||||
|
||||
//hide/show
|
||||
eyebrowLabel.isHidden = eyebrowTextIsEmpty
|
||||
titleLabel.isHidden = titleTextIsEmpty
|
||||
subTitleLabel.isHidden = subTitleTextIsEmpty
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user