Skip to content

Commit 92ad89d

Browse files
Cleanup
1 parent 2f1caef commit 92ad89d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Sources/RichTextRenderer/ViewController/RichTextViewController.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,14 +157,17 @@ open class RichTextViewController: UIViewController, NSLayoutManagerDelegate {
157157
output = output.trim()
158158
}
159159

160-
self.textView.linkTextAttributes = [.foregroundColor: self.renderer.configuration.styleProvider.hyperlinkColor]
161-
162160
self.textStorage.beginEditing()
163161
self.textStorage.setAttributedString(output)
164162
self.textStorage.endEditing()
165163
self.calculateAndSetPreferredContentSize()
164+
self.applyTextViewStyles()
166165
}
167166
}
167+
168+
private func applyTextViewStyles() {
169+
self.textView.linkTextAttributes = [.foregroundColor: self.renderer.configuration.styleProvider.hyperlinkColor]
170+
}
168171

169172
private func calculateAndSetPreferredContentSize() {
170173
let newContentSize = textView.sizeThatFits(textView.bounds.size)

0 commit comments

Comments
 (0)