1 Commits

Author SHA1 Message Date
Nuno Vieira fddf7b06db Update README.md 2022-10-07 11:50:58 +01:00
4 changed files with 5 additions and 6 deletions
+1 -4
View File
@@ -30,8 +30,5 @@ let exampleEmojis: [String: EmojiSource] = [
// aliases
"banana": .alias("banana_dance"),
"parrot": .alias("party_parrot"),
// unicode inside shortcode
"": .character("😊")
"parrot": .alias("party_parrot")
]
+2
View File
@@ -12,6 +12,8 @@
[![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.8'
s.version = '0.1.7'
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|[^\\x00-\\x7F]+|-|\\+)+:", options: [])
let regex = try? NSRegularExpression(pattern: ":(\\w|-|\\+)+:", 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) }
}