From 0df7a937d52d328be1b3a788ca21f2f8e4feb6de Mon Sep 17 00:00:00 2001 From: Marc Etcheverry Date: Tue, 11 Jun 2019 10:18:05 -0700 Subject: [PATCH 1/3] Add support for styling NSLinkAttribute with existing urlAttributes. --- Sources/Views/MessageLabel.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Sources/Views/MessageLabel.swift b/Sources/Views/MessageLabel.swift index 3ea89490..90a78c05 100644 --- a/Sources/Views/MessageLabel.swift +++ b/Sources/Views/MessageLabel.swift @@ -273,6 +273,11 @@ open class MessageLabel: UILabel { guard let rangeTuples = rangesForDetectors[detector] else { continue } for (range, _) in rangeTuples { + // This will enable us to attribute it with our own styles, since `UILabel` does not provide link attribute overrides like `UITextView` does + if detector.textCheckingType == .link { + mutableAttributedString.removeAttribute(NSAttributedString.Key.link, range: range) + } + let attributes = detectorAttributes(for: detector) mutableAttributedString.addAttributes(attributes, range: range) } From 91e1ca15c8e98b5cffe7b41d760530b6f7db50d9 Mon Sep 17 00:00:00 2001 From: Marc Etcheverry Date: Tue, 11 Jun 2019 10:23:14 -0700 Subject: [PATCH 2/3] Update CHANGELOG --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7aba7f2d..4bfe51ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ The changelog for `MessageKit`. Also see the [releases](https://github.com/Messa ## 3.0.0 +## Upcoming Release + +### Added + +- Add support for styling NSLinkAttribute with existing urlAttributes in MessageLabel. [#1091](https://github.com/MessageKit/MessageKit/pull/1091) by [@marcetcheverry](https://github.com/marcetcheverry) + +## Upcoming Release ### Dependency Changes - **Breaking Change** The dependency `MessageInputBar` was replaced with `InputBarAccessoryView`. As `MessageInputBar` was previously a fork this means no functionality has been lost but improvements and bug fixes will be present. `InputBarAccessoryView` has more of a following outside of `MessageKit` making its development faster than `MessageInputBar`. Maintaining two versions only increased the workload. You can find the changelog for `InputBarAccessoryView` [here](https://github.com/nathantannar4/InputBarAccessoryView/blob/master/CHANGELOG.md). From a89152780213c73a2b45314466c3d7a372e482a9 Mon Sep 17 00:00:00 2001 From: Marc Etcheverry Date: Fri, 28 Jun 2019 19:25:18 -0700 Subject: [PATCH 3/3] Fix CHANGELOG --- CHANGELOG.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4bfe51ff..fabeb694 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,15 +2,14 @@ The changelog for `MessageKit`. Also see the [releases](https://github.com/MessageKit/MessageKit/releases) on GitHub. -## 3.0.0 - ## Upcoming Release ### Added - Add support for styling NSLinkAttribute with existing urlAttributes in MessageLabel. [#1091](https://github.com/MessageKit/MessageKit/pull/1091) by [@marcetcheverry](https://github.com/marcetcheverry) -## Upcoming Release +## 3.0.0 + ### Dependency Changes - **Breaking Change** The dependency `MessageInputBar` was replaced with `InputBarAccessoryView`. As `MessageInputBar` was previously a fork this means no functionality has been lost but improvements and bug fixes will be present. `InputBarAccessoryView` has more of a following outside of `MessageKit` making its development faster than `MessageInputBar`. Maintaining two versions only increased the workload. You can find the changelog for `InputBarAccessoryView` [here](https://github.com/nathantannar4/InputBarAccessoryView/blob/master/CHANGELOG.md).