From 4c0d38e39886af5b9695c004810996d65280d3b2 Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Fri, 11 Sep 2020 14:16:11 -0400 Subject: [PATCH 1/8] func added. formating and commenting --- .../Atomic/Atoms/Views/Label/Label.swift | 33 +++++++++++++++---- .../Label/LabelAttributeActionModel.swift | 22 +++++++++++-- .../Label/LabelAttributeColorModel.swift | 1 - .../Views/Label/LabelAttributeFontModel.swift | 2 -- .../Label/LabelAttributeImageModel.swift | 3 +- .../Views/Label/LabelAttributeModel.swift | 11 ++++--- .../LabelAttributeStrikeThroughModel.swift | 14 +++++++- .../Label/LabelAttributeUnderlineModel.swift | 9 ++++- .../Atomic/Atoms/Views/Label/LabelModel.swift | 2 -- 9 files changed, 74 insertions(+), 23 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift b/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift index 73de7760..748013f0 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift @@ -257,8 +257,10 @@ public typealias ActionBlock = () -> () switch labelModel.textAlignment { case .center: textAlignment = .center + case .right: textAlignment = .right + default: textAlignment = .left } @@ -290,7 +292,7 @@ public typealias ActionBlock = () -> () if let color = labelModel.textColor { textColor = color.uiColor } - + if let attributes = labelModel.attributes, let labelText = text { let attributedString = NSMutableAttributedString(string: labelText, attributes: [NSAttributedString.Key.font: font.updateSize(standardFontSize), NSAttributedString.Key.foregroundColor: textColor as UIColor]) @@ -359,7 +361,7 @@ public typealias ActionBlock = () -> () continue } } - + attributedText = attributedString originalAttributedString = attributedText } @@ -503,11 +505,11 @@ public typealias ActionBlock = () -> () textColor = .mvmBlack setScale(scale) } - + //------------------------------------------------------ // MARK: - 2.0 Styling Methods //------------------------------------------------------ - + @objc public func styleH1(_ scale: Bool) { MFStyler.styleLabelH1(self, genericScaling: false) setScale(scale) @@ -548,6 +550,23 @@ public typealias ActionBlock = () -> () setScale(scale) } + /// Will remove the values contained in attributedText. + func clearAttributes() { + + guard let labelText = text, + let attributes = attributedText?.attributes(at: 0, longestEffectiveRange: nil, in: NSRange(location: 0, length: labelText.count)) + else { return } + + let attributedString = NSMutableAttributedString(string: labelText) + + for attribute in attributes { + attributedString.removeAttribute(attribute.key, range: NSRange(location: 0, length: labelText.count)) + } + + attributedText = attributedString + } + + @objc public func updateView(_ size: CGFloat) { scaleSize = size as NSNumber @@ -835,7 +854,7 @@ extension Label { /// Converts the entire text into a link. All characters will be underlined and the intrinsic bounds will respond to tap. @objc public func makeTextButton(actionBlock: @escaping ActionBlock) { - + setTextLinkState(range: getRange, actionBlock: actionBlock) } @@ -920,7 +939,7 @@ extension Label { } @objc public func accessibilityCustomAction(_ action: UIAccessibilityCustomAction) { - + for clause in clauses { if action.hash == clause.accessibilityID { clause.performAction() @@ -930,7 +949,7 @@ extension Label { } open override func accessibilityActivate() -> Bool { - + guard let accessibleActions = accessibilityCustomActions else { return false } for clause in clauses { diff --git a/MVMCoreUI/Atomic/Atoms/Views/Label/LabelAttributeActionModel.swift b/MVMCoreUI/Atomic/Atoms/Views/Label/LabelAttributeActionModel.swift index 3e615cdd..f9920dcc 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/Label/LabelAttributeActionModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/Label/LabelAttributeActionModel.swift @@ -6,23 +6,39 @@ // Copyright © 2019 Verizon Wireless. All rights reserved. // -import UIKit open class LabelAttributeActionModel: LabelAttributeModel { + //-------------------------------------------------- + // MARK: - Properties + //-------------------------------------------------- + override public class var identifier: String { return "action" } + var action: ActionModelProtocol - + + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + public init(_ location: Int, _ length: Int, action: ActionModelProtocol) { self.action = action super.init(location, length) } + //-------------------------------------------------- + // MARK: - Keys + //-------------------------------------------------- + private enum CodingKeys: String, CodingKey { case action } - + + //-------------------------------------------------- + // MARK: - Codec + //-------------------------------------------------- + required public init(from decoder: Decoder) throws { let typeContainer = try decoder.container(keyedBy: CodingKeys.self) action = try typeContainer.decodeModel(codingKey: .action) diff --git a/MVMCoreUI/Atomic/Atoms/Views/Label/LabelAttributeColorModel.swift b/MVMCoreUI/Atomic/Atoms/Views/Label/LabelAttributeColorModel.swift index 86275d6d..b86251c3 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/Label/LabelAttributeColorModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/Label/LabelAttributeColorModel.swift @@ -6,7 +6,6 @@ // Copyright © 2019 Verizon Wireless. All rights reserved. // -import UIKit @objcMembers public class LabelAttributeColorModel: LabelAttributeModel { //-------------------------------------------------- diff --git a/MVMCoreUI/Atomic/Atoms/Views/Label/LabelAttributeFontModel.swift b/MVMCoreUI/Atomic/Atoms/Views/Label/LabelAttributeFontModel.swift index 862f8f9b..59dbac3d 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/Label/LabelAttributeFontModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/Label/LabelAttributeFontModel.swift @@ -6,8 +6,6 @@ // Copyright © 2019 Verizon Wireless. All rights reserved. // -import UIKit - @objcMembers public class LabelAttributeFontModel: LabelAttributeModel { //-------------------------------------------------- diff --git a/MVMCoreUI/Atomic/Atoms/Views/Label/LabelAttributeImageModel.swift b/MVMCoreUI/Atomic/Atoms/Views/Label/LabelAttributeImageModel.swift index 1980353c..70cd90fd 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/Label/LabelAttributeImageModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/Label/LabelAttributeImageModel.swift @@ -6,13 +6,12 @@ // Copyright © 2019 Verizon Wireless. All rights reserved. // -import UIKit class LabelAttributeImageModel: LabelAttributeModel { //-------------------------------------------------- // MARK: - Properties //-------------------------------------------------- - + override public class var identifier: String { return "image" } diff --git a/MVMCoreUI/Atomic/Atoms/Views/Label/LabelAttributeModel.swift b/MVMCoreUI/Atomic/Atoms/Views/Label/LabelAttributeModel.swift index 77f7fde6..ae5f15b7 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/Label/LabelAttributeModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/Label/LabelAttributeModel.swift @@ -6,7 +6,6 @@ // Copyright © 2019 Verizon Wireless. All rights reserved. // -import Foundation @objcMembers open class LabelAttributeModel: ModelProtocol { //-------------------------------------------------- @@ -20,7 +19,7 @@ import Foundation public static var categoryCodingKey: String { return "type" } - + public class var identifier: String { return "" } @@ -31,12 +30,16 @@ import Foundation var location: Int var length: Int - + + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + public init(_ location: Int, _ length: Int) { self.location = location self.length = length } - + //-------------------------------------------------- // MARK: - Keys //-------------------------------------------------- diff --git a/MVMCoreUI/Atomic/Atoms/Views/Label/LabelAttributeStrikeThroughModel.swift b/MVMCoreUI/Atomic/Atoms/Views/Label/LabelAttributeStrikeThroughModel.swift index 59552e18..e84c1804 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/Label/LabelAttributeStrikeThroughModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/Label/LabelAttributeStrikeThroughModel.swift @@ -6,16 +6,28 @@ // Copyright © 2019 Verizon Wireless. All rights reserved. // -import UIKit @objcMembers public class LabelAttributeStrikeThroughModel: LabelAttributeModel { + //-------------------------------------------------- + // MARK: - Properties + //-------------------------------------------------- + override public class var identifier: String { return "strikethrough" } + + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + required public init(from decoder: Decoder) throws { try super.init(from: decoder) } + //-------------------------------------------------- + // MARK: - Codec + //-------------------------------------------------- + public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) } diff --git a/MVMCoreUI/Atomic/Atoms/Views/Label/LabelAttributeUnderlineModel.swift b/MVMCoreUI/Atomic/Atoms/Views/Label/LabelAttributeUnderlineModel.swift index d052686d..597b2491 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/Label/LabelAttributeUnderlineModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/Label/LabelAttributeUnderlineModel.swift @@ -6,13 +6,20 @@ // Copyright © 2019 Verizon Wireless. All rights reserved. // -import UIKit @objcMembers public class LabelAttributeUnderlineModel: LabelAttributeModel { + //-------------------------------------------------- + // MARK: - Properties + //-------------------------------------------------- + override public class var identifier: String { return "underline" } + //-------------------------------------------------- + // MARK: - Codec + //-------------------------------------------------- + required public init(from decoder: Decoder) throws { try super.init(from: decoder) } diff --git a/MVMCoreUI/Atomic/Atoms/Views/Label/LabelModel.swift b/MVMCoreUI/Atomic/Atoms/Views/Label/LabelModel.swift index 4ec23ad6..6b120d0c 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/Label/LabelModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/Label/LabelModel.swift @@ -7,8 +7,6 @@ // -import Foundation - @objcMembers public class LabelModel: MoleculeModelProtocol { //-------------------------------------------------- // MARK: - Properties From 108eca30dbb60796354259afc4a910cff34f58c5 Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Wed, 30 Sep 2020 15:22:39 -0400 Subject: [PATCH 2/8] iOS 13/14 issue fix. --- MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift b/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift index 748013f0..87939c52 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift @@ -247,6 +247,7 @@ public typealias ActionBlock = () -> () return } + text = nil attributedText = nil originalAttributedString = nil text = labelModel.text @@ -365,6 +366,20 @@ public typealias ActionBlock = () -> () attributedText = attributedString originalAttributedString = attributedText } + + /* + * This is to address a reuse issue beginning with iOS 13 (also present in iOS 14). + * Even if you set text & attributedText to nil, the moment you set text with a value, + * attributedText will hold dirty value from a previously reused cell. + */ + if #available(iOS 13, *) { + if labelModel.attributes == nil, let text = text { + let attributedString = NSMutableAttributedString(string: text, + attributes: [NSAttributedString.Key.font: font.updateSize(standardFontSize), NSAttributedString.Key.foregroundColor: textColor as UIColor]) + attributedString.addAttribute(.underlineStyle, value: 0, range: NSRange(location: 0, length: text.count)) + attributedText = attributedString + } + } } @objc public static func setUILabel(_ label: UILabel?, withJSON json: [AnyHashable: Any]?, delegate: DelegateObject?, additionalData: [AnyHashable: Any]?) { From 84a300eba73dacbfeabc5382b18c2001afbdaf80 Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Wed, 30 Sep 2020 15:54:51 -0400 Subject: [PATCH 3/8] checked & comment --- MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift b/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift index 87939c52..fe6b31eb 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift @@ -368,14 +368,16 @@ public typealias ActionBlock = () -> () } /* - * This is to address a reuse issue beginning with iOS 13 (also present in iOS 14). + * This is to address a reuse issue with iOS 13 and up. * Even if you set text & attributedText to nil, the moment you set text with a value, - * attributedText will hold dirty value from a previously reused cell. + * attributedText will hold a dirty value from a previously reused cell even if reset() is + * appropriately called. + * Only other reference found of issue: https://www.thetopsites.net/article/58142205.shtml */ if #available(iOS 13, *) { - if labelModel.attributes == nil, let text = text { - let attributedString = NSMutableAttributedString(string: text, - attributes: [NSAttributedString.Key.font: font.updateSize(standardFontSize), NSAttributedString.Key.foregroundColor: textColor as UIColor]) + // Case where no attributes are set in the model but attributedText has a value. + if labelModel.attributes == nil && attributedText != nil, let text = text { + let attributedString = NSMutableAttributedString(string: text) attributedString.addAttribute(.underlineStyle, value: 0, range: NSRange(location: 0, length: text.count)) attributedText = attributedString } From 592e0a9591b114af0b81f017f1ecdf097017e172 Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Thu, 1 Oct 2020 09:03:48 -0400 Subject: [PATCH 4/8] move logic up --- .../Atomic/Atoms/Views/Label/Label.swift | 33 ++++++++++--------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift b/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift index fe6b31eb..a5bf5f5e 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift @@ -251,6 +251,23 @@ public typealias ActionBlock = () -> () attributedText = nil originalAttributedString = nil text = labelModel.text + + /* + * This is to address a reuse issue with iOS 13 and up. + * Even if you set text & attributedText to nil, the moment you set text with a value, + * attributedText will hold a dirty value from a previously reused cell even if reset() is + * appropriately called. + * Only other reference found of issue: https://www.thetopsites.net/article/58142205.shtml + */ + if #available(iOS 13, *) { + // Case where no attributes are set in the model but attributedText has a value. + if attributedText != nil, let text = text { + let attributedString = NSMutableAttributedString(string: text) + attributedString.addAttribute(.underlineStyle, value: 0, range: NSRange(location: 0, length: text.count)) + attributedText = attributedString + } + } + hero = labelModel.hero Label.setLabel(self, withHTML: labelModel.html) isAccessibilityElement = hasText @@ -366,22 +383,6 @@ public typealias ActionBlock = () -> () attributedText = attributedString originalAttributedString = attributedText } - - /* - * This is to address a reuse issue with iOS 13 and up. - * Even if you set text & attributedText to nil, the moment you set text with a value, - * attributedText will hold a dirty value from a previously reused cell even if reset() is - * appropriately called. - * Only other reference found of issue: https://www.thetopsites.net/article/58142205.shtml - */ - if #available(iOS 13, *) { - // Case where no attributes are set in the model but attributedText has a value. - if labelModel.attributes == nil && attributedText != nil, let text = text { - let attributedString = NSMutableAttributedString(string: text) - attributedString.addAttribute(.underlineStyle, value: 0, range: NSRange(location: 0, length: text.count)) - attributedText = attributedString - } - } } @objc public static func setUILabel(_ label: UILabel?, withJSON json: [AnyHashable: Any]?, delegate: DelegateObject?, additionalData: [AnyHashable: Any]?) { From 0ba5da2add4d78b6f740eea873dbbae828020585 Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Thu, 1 Oct 2020 12:15:45 -0400 Subject: [PATCH 5/8] latest state --- .../Atomic/Atoms/Views/Label/Label.swift | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift b/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift index a5bf5f5e..62af450d 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift @@ -252,6 +252,8 @@ public typealias ActionBlock = () -> () originalAttributedString = nil text = labelModel.text + print("SET before:\n \(attributedText)") + /* * This is to address a reuse issue with iOS 13 and up. * Even if you set text & attributedText to nil, the moment you set text with a value, @@ -261,13 +263,23 @@ public typealias ActionBlock = () -> () */ if #available(iOS 13, *) { // Case where no attributes are set in the model but attributedText has a value. - if attributedText != nil, let text = text { + if let attributedText = attributedText, let text = text { let attributedString = NSMutableAttributedString(string: text) - attributedString.addAttribute(.underlineStyle, value: 0, range: NSRange(location: 0, length: text.count)) - attributedText = attributedString + for attributes in attributedText.attributes(at: 0, effectiveRange: nil) { + if attributes.key == .underlineStyle { + attributedString.addAttribute(.underlineStyle, value: 0, range: NSRange(location: 0, length: text.count)) + } + if attributes.key == .strikethroughStyle { + attributedString.addAttribute(.strikethroughStyle, value: 0, range: NSRange(location: 0, length: text.count)) + } + } + + self.attributedText = attributedString } } + print("SET after:\n \(attributedText)") + hero = labelModel.hero Label.setLabel(self, withHTML: labelModel.html) isAccessibilityElement = hasText @@ -382,7 +394,9 @@ public typealias ActionBlock = () -> () attributedText = attributedString originalAttributedString = attributedText + print("SET new attribute:\n \(attributedText)") } + print("SET DONE FUNC:\n \(attributedText)") } @objc public static func setUILabel(_ label: UILabel?, withJSON json: [AnyHashable: Any]?, delegate: DelegateObject?, additionalData: [AnyHashable: Any]?) { @@ -773,6 +787,7 @@ extension Label { public func reset() { text = nil attributedText = nil + print("reset:\n \(attributedText)") hero = nil textAlignment = .left originalAttributedString = nil From 5bac63324ff0e34d3a8d9b6e5afc6b1a302d42d6 Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Thu, 1 Oct 2020 14:45:18 -0400 Subject: [PATCH 6/8] update --- .../Atomic/Atoms/Views/Label/Label.swift | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift b/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift index 62af450d..bea0dfea 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift @@ -252,8 +252,6 @@ public typealias ActionBlock = () -> () originalAttributedString = nil text = labelModel.text - print("SET before:\n \(attributedText)") - /* * This is to address a reuse issue with iOS 13 and up. * Even if you set text & attributedText to nil, the moment you set text with a value, @@ -262,15 +260,15 @@ public typealias ActionBlock = () -> () * Only other reference found of issue: https://www.thetopsites.net/article/58142205.shtml */ if #available(iOS 13, *) { - // Case where no attributes are set in the model but attributedText has a value. if let attributedText = attributedText, let text = text { let attributedString = NSMutableAttributedString(string: text) - for attributes in attributedText.attributes(at: 0, effectiveRange: nil) { - if attributes.key == .underlineStyle { - attributedString.addAttribute(.underlineStyle, value: 0, range: NSRange(location: 0, length: text.count)) + let range = NSRange(location: 0, length: text.count) + for attribute in attributedText.attributes(at: 0, effectiveRange: nil) { + if attribute.key == .underlineStyle { + attributedString.addAttribute(.underlineStyle, value: 0, range: range) } - if attributes.key == .strikethroughStyle { - attributedString.addAttribute(.strikethroughStyle, value: 0, range: NSRange(location: 0, length: text.count)) + if attribute.key == .strikethroughStyle { + attributedString.addAttribute(.strikethroughStyle, value: 0, range: range) } } @@ -278,8 +276,6 @@ public typealias ActionBlock = () -> () } } - print("SET after:\n \(attributedText)") - hero = labelModel.hero Label.setLabel(self, withHTML: labelModel.html) isAccessibilityElement = hasText @@ -394,9 +390,7 @@ public typealias ActionBlock = () -> () attributedText = attributedString originalAttributedString = attributedText - print("SET new attribute:\n \(attributedText)") } - print("SET DONE FUNC:\n \(attributedText)") } @objc public static func setUILabel(_ label: UILabel?, withJSON json: [AnyHashable: Any]?, delegate: DelegateObject?, additionalData: [AnyHashable: Any]?) { @@ -787,7 +781,6 @@ extension Label { public func reset() { text = nil attributedText = nil - print("reset:\n \(attributedText)") hero = nil textAlignment = .left originalAttributedString = nil From 40f2b5db172f55f9fccdad2d204e8739f48e1f4c Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Fri, 2 Oct 2020 12:00:09 -0400 Subject: [PATCH 7/8] moved logic --- MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift b/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift index bea0dfea..d8e53a30 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift @@ -241,15 +241,15 @@ public typealias ActionBlock = () -> () public func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) { clauses = [] + text = nil + attributedText = nil + originalAttributedString = nil guard let labelModel = model as? LabelModel else { text = "" return } - text = nil - attributedText = nil - originalAttributedString = nil text = labelModel.text /* From e676e1f7c1df21b9da8222ea8d2f419187af6c9d Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Fri, 2 Oct 2020 12:17:51 -0400 Subject: [PATCH 8/8] not needed --- MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift b/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift index d8e53a30..15cf5a22 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift @@ -245,10 +245,7 @@ public typealias ActionBlock = () -> () attributedText = nil originalAttributedString = nil - guard let labelModel = model as? LabelModel else { - text = "" - return - } + guard let labelModel = model as? LabelModel else { return } text = labelModel.text