diff --git a/MVMCoreUI/Atoms/Views/Label.swift b/MVMCoreUI/Atoms/Views/Label.swift index 5792f1c7..0dfd2ba1 100644 --- a/MVMCoreUI/Atoms/Views/Label.swift +++ b/MVMCoreUI/Atoms/Views/Label.swift @@ -413,15 +413,18 @@ public typealias ActionBlock = () -> Void let mutableString = NSMutableAttributedString(attributedString: attributedText) - if index != 0 { + if index == 0 { + mutableString.insert(NSAttributedString(attachment: Label.getTextAttachmentImage(dimension: font.pointSize)), at: index) + } else { mutableString.insert(NSAttributedString(string: " "), at: index) + mutableString.insert(NSAttributedString(attachment: Label.getTextAttachmentImage(dimension: font.pointSize)), at: index + 1) } - mutableString.insert(NSAttributedString(attachment: Label.getTextAttachmentImage(dimension: font.pointSize)), at: index + 1) + self.attributedText = mutableString - if index < attributedText.length { - hasAttachmentImageInsideText = true - } +// if index < attributedText.length { +// hasAttachmentImageInsideText = true +// } } static func getTextAttachmentImage(dimension: CGFloat) -> NSTextAttachment { @@ -588,6 +591,7 @@ extension UITapGestureRecognizer { func didTapAttributedTextInLabel(_ label: Label, inRange targetRange: NSRange, offset: Int) -> Bool { + // There would only ever be one clause to act on. if label.makeWholeViewClickable { return true }