2 Commits

Author SHA1 Message Date
cardoso 33e24166ee Bump version 2020-08-07 11:38:08 -03:00
cardoso 6588647286 Support unicode characters inside shortcode 2020-08-07 11:37:32 -03:00
4 changed files with 6 additions and 5 deletions
+4 -1
View File
@@ -30,5 +30,8 @@ let exampleEmojis: [String: EmojiSource] = [
// aliases
"banana": .alias("banana_dance"),
"parrot": .alias("party_parrot")
"parrot": .alias("party_parrot"),
// unicode inside shortcode
"": .character("😊")
]
-2
View File
@@ -12,8 +12,6 @@
[![Twitter](https://img.shields.io/twitter/url?url=https%3A%2F%2Fgithub.com%2FGetStream%2FStreamoji)](https://twitter.com/intent/tweet?text=Wow:&url=https%3A%2F%2Fgithub.com%2FGetStream%2FStreamoji)
[![Twitter Follow](https://img.shields.io/twitter/follow/getstream_io?style=social)](https://twitter.com/intent/follow?screen_name=getstream_io)
### :warning: This project has a new home :house: https://github.com/cardoso/Streamoji
Custom emojis are a fun way to bring more life and customizability to your apps. They're available in some of the most popular apps, such as Slack, Discord, and Twitch. However, iOS SDK doesn't provide straight forward support for custom emojis out of the box. Now, you're a couple code lines away from adding them to your own app with this library.
Streamoji is a custom emoji rendering library for iOS. It supports GIF <img src="https://github.com/GetStream/Streamoji/blob/main/meta/emojis/carlton.gif?raw=true" width="24" />, images <img src="https://github.com/GetStream/Streamoji/blob/main/meta/emojis/doge.png?raw=true" width="24"/>, and unicode 🦊. It loads from URLs or local assets. Caching is taken care of and performance is ⚡️ fast! Made with 💘 by the folks @ [Stream](https://getstream.io).
+1 -1
View File
@@ -8,7 +8,7 @@
Pod::Spec.new do |s|
s.name = 'Streamoji'
s.version = '0.1.7'
s.version = '0.1.8'
s.summary = 'Custom emoji rendering library for iOS apps with support for GIF & images.'
s.swift_version = '5.2'
@@ -41,7 +41,7 @@ extension NSAttributedString {
}
ranges.append(NSRange(location: lastMatchIndex, length: length - lastMatchIndex))
let regex = try? NSRegularExpression(pattern: ":(\\w|-|\\+)+:", options: [])
let regex = try? NSRegularExpression(pattern: ":(\\w|[^\\x00-\\x7F]+|-|\\+)+:", options: [])
let matchRanges = ranges.map { range in regex?.matches(in: string, options: [], range: range).map { $0.range(at: 0) } ?? [] }
return matchRanges.reduce(into: [NSRange]()) { $0.append(contentsOf: $1) }
}