mirror of
https://github.com/MessageKit/MessageKit.git
synced 2026-02-06 19:03:19 +00:00
TransitInformation - Updated handleTransitInfo method name and updated change log
This commit is contained in:
@@ -34,6 +34,9 @@ The changelog for `MessageKit`. Also see the [releases](https://github.com/Messa
|
||||
- `layoutBottomLabel(with attributes: MessagesCollectionViewLayoutAttributes)`
|
||||
[#491](https://github.com/MessageKit/MessageKit/pull/491) by [@SD10](https://github.com/SD10).
|
||||
|
||||
- **Breaking Change** Adds new `DetectorType` called `TransitInformation` to message label.
|
||||
[#520](https://github.com/MessageKit/MessageKit/pull/520) by [@nosarj](https://github.com/nosarj).
|
||||
|
||||
### [[Prerelease] 0.13.1](https://github.com/MessageKit/MessageKit/releases/tag/0.13.1)
|
||||
|
||||
### Fixed
|
||||
|
||||
@@ -335,7 +335,7 @@ open class MessageLabel: UILabel {
|
||||
rangesForDetectors.updateValue(ranges, forKey: .url)
|
||||
case .transitInformation:
|
||||
var ranges = rangesForDetectors[.transitInformation] ?? []
|
||||
let tuple: (NSRange, MessageTextCheckingType) = (result.range, .transitInformationComponents(result.components))
|
||||
let tuple: (NSRange, MessageTextCheckingType) = (result.range, .transitInfoComponents(result.components))
|
||||
ranges.append(tuple)
|
||||
rangesForDetectors.updateValue(ranges, forKey: .transitInformation)
|
||||
|
||||
@@ -406,7 +406,7 @@ open class MessageLabel: UILabel {
|
||||
case let .link(url):
|
||||
guard let url = url else { return }
|
||||
handleURL(url)
|
||||
case let .transitInformationComponents(transitInformation):
|
||||
case let .transitInfoComponents(transitInformation):
|
||||
var transformedTransitInformation = [String: String]()
|
||||
guard let transitInformation = transitInformation else { return }
|
||||
transitInformation.forEach { (key, value) in
|
||||
@@ -432,8 +432,8 @@ open class MessageLabel: UILabel {
|
||||
delegate?.didSelectPhoneNumber(phoneNumber)
|
||||
}
|
||||
|
||||
private func handleTransitInformation(_ transitInformationComponents: [String: String]) {
|
||||
delegate?.didSelectTransitInformation(transitInformationComponents)
|
||||
private func handleTransitInformation(_ components: [String: String]) {
|
||||
delegate?.didSelectTransitInformation(components)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -443,5 +443,5 @@ private enum MessageTextCheckingType {
|
||||
case date(Date?)
|
||||
case phoneNumber(String?)
|
||||
case link(URL?)
|
||||
case transitInformationComponents([NSTextCheckingKey: String]?)
|
||||
case transitInfoComponents([NSTextCheckingKey: String]?)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user