added string empty checks.
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
849dc0a7b9
commit
60f71a7709
@ -286,7 +286,7 @@ open class Label: UILabel, ViewProtocol, UserInfoable {
|
|||||||
|
|
||||||
private func styleText(_ newValue: String!) {
|
private func styleText(_ newValue: String!) {
|
||||||
defer { invalidateIntrinsicContentSize() }
|
defer { invalidateIntrinsicContentSize() }
|
||||||
guard let newValue else {
|
guard let newValue, !newValue.isEmpty else {
|
||||||
// We don't need to use attributed text
|
// We don't need to use attributed text
|
||||||
super.attributedText = nil
|
super.attributedText = nil
|
||||||
super.text = newValue
|
super.text = newValue
|
||||||
@ -311,7 +311,7 @@ open class Label: UILabel, ViewProtocol, UserInfoable {
|
|||||||
|
|
||||||
private func styleAttributedText(_ newValue: NSAttributedString?) {
|
private func styleAttributedText(_ newValue: NSAttributedString?) {
|
||||||
defer { invalidateIntrinsicContentSize() }
|
defer { invalidateIntrinsicContentSize() }
|
||||||
guard let newValue = newValue else {
|
guard let newValue, !newValue.string.isEmpty else {
|
||||||
// We don't need any additional styling
|
// We don't need any additional styling
|
||||||
super.attributedText = newValue
|
super.attributedText = newValue
|
||||||
return
|
return
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user