TransitInformation - Updated handleTransitInfo method name and updated change log

This commit is contained in:
Yishai
2018-02-15 13:16:15 +00:00
parent c5c4bd4c86
commit 516f8e4152
2 changed files with 8 additions and 5 deletions
+3
View File
@@ -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
+5 -5
View File
@@ -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]?)
}