From 9c9f3875a7b0b51011b410c6dd1fb275aa645fae Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Wed, 22 Aug 2018 15:07:05 -0600 Subject: [PATCH] Link styling --- .../src/ViewControllers/LongTextViewController.swift | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Signal/src/ViewControllers/LongTextViewController.swift b/Signal/src/ViewControllers/LongTextViewController.swift index 80cafd5ca..843c4f3d8 100644 --- a/Signal/src/ViewControllers/LongTextViewController.swift +++ b/Signal/src/ViewControllers/LongTextViewController.swift @@ -77,6 +77,17 @@ public class LongTextViewController: OWSViewController { messageTextView.dataDetectorTypes = OWSAllowedDataDetectorTypes messageTextView.text = messageBody + // RADAR #18669 + // https://github.com/lionheart/openradar-mirror/issues/18669 + // + // UITextView’s linkTextAttributes property has type [String : Any]! but should be [NSAttributedStringKey : Any]! in Swift 4. + let linkTextAttributes: [String: Any] = [ + NSAttributedStringKey.foregroundColor.rawValue: Theme.primaryColor, + NSAttributedStringKey.underlineColor.rawValue: Theme.primaryColor, + NSAttributedStringKey.underlineStyle.rawValue: NSUnderlineStyle.styleSingle.rawValue + ] + messageTextView.linkTextAttributes = linkTextAttributes + view.addSubview(messageTextView) messageTextView.autoPinEdge(toSuperviewEdge: .top) messageTextView.autoPinEdge(toSuperviewMargin: .leading)