mirror of
https://github.com/MessageKit/MessageKit.git
synced 2026-02-06 19:03:19 +00:00
[DetectorType] add .mention, .hashtag and .custon() to detect your own pattern
[DetectorType] Put mention and hashtag as var [CHANGELOG] Update [DetectorType] Update to have at least 4 characters and more [CHANGELOG] Update [DetectorType] [MessageLabel] run NSDataDetector once [MessageLabel] Run NSDataDetector once [Testing] Add testing and pass rangesOfDetectors as internal [Refactoring] [Filter] only .custom [Examples]
This commit is contained in:
@@ -46,7 +46,7 @@ final internal class SampleData {
|
||||
|
||||
let messageImages: [UIImage] = [#imageLiteral(resourceName: "img1"), #imageLiteral(resourceName: "img2")]
|
||||
|
||||
let messageTypes = ["Text", "Text", "Text", "AttributedText", "Location", "Photo", "Emoji", "Video", "URL", "Phone", "Custom"]
|
||||
let messageTypes = ["Text", "Text", "Text", "AttributedText", "Location", "Photo", "Emoji", "Video", "URL", "Phone", "Mention", "Hashtag", "Custom"]
|
||||
|
||||
let emojis = [
|
||||
"👍",
|
||||
@@ -150,6 +150,10 @@ final internal class SampleData {
|
||||
return MockMessage(text: "https://github.com/MessageKit", sender: sender, messageId: uniqueID, date: date)
|
||||
case "Phone":
|
||||
return MockMessage(text: "123-456-7890", sender: sender, messageId: uniqueID, date: date)
|
||||
case "Mention":
|
||||
return MockMessage(text: "@messagekit", sender: sender, messageId: uniqueID, date: date)
|
||||
case "Hashtag":
|
||||
return MockMessage(text: "#messagekit", sender: sender, messageId: uniqueID, date: date)
|
||||
case "Custom":
|
||||
return MockMessage(custom: "Someone left the conversation", sender: system, messageId: uniqueID, date: date)
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user