diff --git a/MVMCoreUI/Atoms/Views/LabelWithInternalButton.swift b/MVMCoreUI/Atoms/Views/LabelWithInternalButton.swift index cda4d6ec..2473bf85 100644 --- a/MVMCoreUI/Atoms/Views/LabelWithInternalButton.swift +++ b/MVMCoreUI/Atoms/Views/LabelWithInternalButton.swift @@ -28,17 +28,14 @@ public typealias CoreObjectActionLoadPresentDelegate = MVMCoreActionDelegateProt willSet(newAttributedText) { if let newAttribText = newAttributedText, !newAttribText.string.isEmpty { - let mutableAttributedText = newAttribText as? NSMutableAttributedString + let mutableAttributedText = NSMutableAttributedString(attributedString: newAttribText) let paragraphStyle = NSMutableParagraphStyle() paragraphStyle.lineSpacing = CGFloat(LabelWithInternalButtonLineSpace) if newAttribText.length > 0 { - mutableAttributedText?.addAttribute(.paragraphStyle, value: paragraphStyle, range: NSRange(location: 0, length: newAttribText.length)) - } - - if let mutableAttText = mutableAttributedText { - label?.attributedText = mutableAttText + mutableAttributedText.addAttribute(.paragraphStyle, value: paragraphStyle, range: NSRange(location: 0, length: newAttribText.length)) } + label?.attributedText = mutableAttributedText } } }