From e19364abdf1c17d6a2aa4065f79d1e262e98a5e5 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Sat, 18 Jan 2020 18:21:01 -0500 Subject: [PATCH] Fix content text view text color in dark mode --- Tusker/Views/ContentTextView.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Tusker/Views/ContentTextView.swift b/Tusker/Views/ContentTextView.swift index bae5d7d9..e77198c5 100644 --- a/Tusker/Views/ContentTextView.swift +++ b/Tusker/Views/ContentTextView.swift @@ -19,6 +19,7 @@ class ContentTextView: LinkTextView { var navigationDelegate: TuskerNavigationDelegate? var defaultFont: UIFont = .systemFont(ofSize: 17) + var defaultColor: UIColor = .label override func awakeFromNib() { super.awakeFromNib() @@ -117,9 +118,9 @@ class ContentTextView: LinkTextView { } else { text = node.text() } - return NSAttributedString(string: text, attributes: [.font: defaultFont]) + return NSAttributedString(string: text, attributes: [.font: defaultFont, .foregroundColor: defaultColor]) case let node as Element: - let attributed = NSMutableAttributedString(string: "", attributes: [.font: defaultFont]) + let attributed = NSMutableAttributedString(string: "", attributes: [.font: defaultFont, .foregroundColor: defaultColor]) for child in node.getChildNodes() { attributed.append(attributedTextForHTMLNode(child, usePreformattedText: usePreformattedText || node.tagName() == "pre")) }