Fixed how NSMutableAttribute is used.
This commit is contained in:
parent
14d66d1fc6
commit
baa0f3d3f7
@ -28,17 +28,14 @@ public typealias CoreObjectActionLoadPresentDelegate = MVMCoreActionDelegateProt
|
|||||||
willSet(newAttributedText) {
|
willSet(newAttributedText) {
|
||||||
if let newAttribText = newAttributedText, !newAttribText.string.isEmpty {
|
if let newAttribText = newAttributedText, !newAttribText.string.isEmpty {
|
||||||
|
|
||||||
let mutableAttributedText = newAttribText as? NSMutableAttributedString
|
let mutableAttributedText = NSMutableAttributedString(attributedString: newAttribText)
|
||||||
let paragraphStyle = NSMutableParagraphStyle()
|
let paragraphStyle = NSMutableParagraphStyle()
|
||||||
paragraphStyle.lineSpacing = CGFloat(LabelWithInternalButtonLineSpace)
|
paragraphStyle.lineSpacing = CGFloat(LabelWithInternalButtonLineSpace)
|
||||||
|
|
||||||
if newAttribText.length > 0 {
|
if newAttribText.length > 0 {
|
||||||
mutableAttributedText?.addAttribute(.paragraphStyle, value: paragraphStyle, range: NSRange(location: 0, length: newAttribText.length))
|
mutableAttributedText.addAttribute(.paragraphStyle, value: paragraphStyle, range: NSRange(location: 0, length: newAttribText.length))
|
||||||
}
|
|
||||||
|
|
||||||
if let mutableAttText = mutableAttributedText {
|
|
||||||
label?.attributedText = mutableAttText
|
|
||||||
}
|
}
|
||||||
|
label?.attributedText = mutableAttributedText
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user