From 9f806d396357e9afd140ad1a32aa6efa529cd84e Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Sat, 30 Mar 2019 08:35:53 -0600 Subject: [PATCH] respond to fixed radar (hooray) --- .../LongTextViewController.swift | 20 +++++-------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/Signal/src/ViewControllers/LongTextViewController.swift b/Signal/src/ViewControllers/LongTextViewController.swift index 295b939cf..a118e6c50 100644 --- a/Signal/src/ViewControllers/LongTextViewController.swift +++ b/Signal/src/ViewControllers/LongTextViewController.swift @@ -137,16 +137,12 @@ public class LongTextViewController: OWSViewController { messageTextView.text = "" } - // 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] = [ - NSAttributedString.Key.foregroundColor.rawValue: Theme.primaryColor, - NSAttributedString.Key.underlineColor.rawValue: Theme.primaryColor, - NSAttributedString.Key.underlineStyle.rawValue: NSUnderlineStyle.single.rawValue + let linkTextAttributes: [NSAttributedString.Key: Any] = [ + NSAttributedString.Key.foregroundColor: Theme.primaryColor, + NSAttributedString.Key.underlineColor: Theme.primaryColor, + NSAttributedString.Key.underlineStyle: NSUnderlineStyle.single.rawValue ] - messageTextView.linkTextAttributes = convertToOptionalNSAttributedStringKeyDictionary(linkTextAttributes) + messageTextView.linkTextAttributes = linkTextAttributes view.addSubview(messageTextView) messageTextView.autoPinEdge(toSuperviewEdge: .top) @@ -173,9 +169,3 @@ public class LongTextViewController: OWSViewController { AttachmentSharing.showShareUI(forText: fullText) } } - -// Helper function inserted by Swift 4.2 migrator. -private func convertToOptionalNSAttributedStringKeyDictionary(_ input: [String: Any]?) -> [NSAttributedString.Key: Any]? { - guard let input = input else { return nil } - return Dictionary(uniqueKeysWithValues: input.map { key, value in (NSAttributedString.Key(rawValue: key), value)}) -}