Swift 3 emoji parser for String
, NSAttributedString
and NSMutableAttributedString
. It replaces sub strings on the form ":emoji:"
with its corresponding emoji character. The emoji lookup table is taken from github/gemoji.
import Emojize
let string = "This is a :car:"
string.emojified // => "This is a 🚗"
NSMutableAttributedString(string: string).emojified.string // => "This is a 🚗"
NSAttributedString(string: string).emojified.string // => "This is a 🚗"
Add pod 'Emojize'
to your Podfile
and run pod install
.