mirror of
https://github.com/MessageKit/MessageKit.git
synced 2026-02-06 19:03:19 +00:00
Merge pull request #1091 from marcetcheverry/3.0.0-swift5-NSLinkAttribute
Add support for styling NSLinkAttribute with existing urlAttributes in MessageLabel
This commit is contained in:
@@ -6,6 +6,8 @@ The changelog for `MessageKit`. Also see the [releases](https://github.com/Messa
|
||||
|
||||
### 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)
|
||||
|
||||
- Add loading indicator to AudioMessageCell. [#1084](https://github.com/MessageKit/MessageKit/pull/1084) by [@marcetcheverry](https://github.com/marcetcheverry)
|
||||
|
||||
- Lazily initialize the MessageInputBar on MessagesViewController. [#1092](https://github.com/MessageKit/MessageKit/pull/1092) by [@marcetcheverry](https://github.com/marcetcheverry)
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user