Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Trying to figure out how to apply skin tone modifiers to gemoji
import Foundation
// Each pair below is a "base" emoji copied from gemoji's emoji.json,
// followed by a modified emoji copied from OS X' "Emoji & Symbols" menu.
// You can run this by copying this file into a Swift playground.
// For readers' convenience, I've printed the output inline below.
// 1.
"🖐️".unicodeScalars.forEach { (c) in
print(c.escaped(asASCII: true), terminator: "")
}
print("") // \u{0001F590}\u{FE0F}
"🖐🏻".unicodeScalars.forEach { (c) in
print(c.escaped(asASCII: true), terminator: "")
}
print("") // \u{0001F590}\u{0001F3FB}
// 2.
"💆‍♂️".unicodeScalars.forEach { (c) in
print(c.escaped(asASCII: true), terminator: "")
}
print("") // \u{0001F486}\u{200D}\u{2642}\u{FE0F}
"💆🏻‍♂️".unicodeScalars.forEach { (c) in
print(c.escaped(asASCII: true), terminator: "")
}
print("") // \u{0001F486}\u{0001F3FB}\u{200D}\u{2642}\u{FE0F}
// 3.
"🕵️‍♂️".unicodeScalars.forEach { (c) in
print(c.escaped(asASCII: true), terminator: "")
}
print("") // \u{0001F575}\u{FE0F}\u{200D}\u{2642}\u{FE0F}
"🕵🏻‍♂️".unicodeScalars.forEach { (c) in
print(c.escaped(asASCII: true), terminator: "")
}
print("") // \u{0001F575}\u{0001F3FB}\u{200D}\u{2642}\u{FE0F}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment