highlight `Note to Self`

This commit is contained in:
Ryan Zhao 2022-01-19 10:59:49 +11:00
parent 5c112064da
commit af7dd3e82f
1 changed files with 4 additions and 0 deletions

View File

@ -226,6 +226,10 @@ final class ConversationCell : UITableViewCell {
}
private func getHighlightedSnippet(snippet: String, searchText: String) -> NSMutableAttributedString {
guard snippet != NSLocalizedString("NOTE_TO_SELF", comment: "") else {
return NSMutableAttributedString(string: snippet, attributes: [.foregroundColor:Colors.text])
}
let result = NSMutableAttributedString(string: snippet, attributes: [.foregroundColor:UIColor.gray])
let normalizedSnippet = snippet.lowercased() as NSString
let normalizedSearchText = searchText.lowercased()