From 7a86febc7c8f7ce60fb46b0b182dfd7cf44231c5 Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Thu, 25 Jul 2019 15:15:32 -0400 Subject: [PATCH] corrected logic error. --- MVMCoreUI/Atoms/Views/Label.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MVMCoreUI/Atoms/Views/Label.swift b/MVMCoreUI/Atoms/Views/Label.swift index 186c24c8..c1ba5ef5 100644 --- a/MVMCoreUI/Atoms/Views/Label.swift +++ b/MVMCoreUI/Atoms/Views/Label.swift @@ -358,7 +358,7 @@ public typealias ActionBlock = () -> Void Appends an external link image to the end of the attributed string. Will provide one whitespace to the left of the icon */ - public func appendExternalLinkIcon() { + @objc public func appendExternalLinkIcon() { guard let attributedText = attributedText else { return } @@ -386,9 +386,9 @@ public typealias ActionBlock = () -> Void let mutableString = NSMutableAttributedString(attributedString: attributedText) if index != 0 { - mutableString.insert(NSAttributedString(string: " "), at: index - 1) + mutableString.insert(NSAttributedString(string: " "), at: index) } - mutableString.insert(NSAttributedString(attachment: Label.getTextAttachmentImage(dimension: font.pointSize)), at: index) + mutableString.insert(NSAttributedString(attachment: Label.getTextAttachmentImage(dimension: font.pointSize)), at: index + 1) self.attributedText = mutableString hasAttachmentImage = true