-4

I am new to swift programming.I am working in an app of emoji.When i click an emoji from Apple keyboard it show the unicode of that emoji.How can i get this.

Yaseen Khan
  • 11
  • 1
  • 4
  • If you want to get the unicode of a emoji in swift you should take a look at: https://stackoverflow.com/a/27278005/2164516 – Milander Jul 26 '18 at 12:26

2 Answers2

3

Here is list of uicodes

https://apps.timwhitlock.info/emoji/tables/unicode

you can also use Edit->Emoji and drag the to the text

let str = "Ti \u{1F601} tle"

enter image description here

enter image description here

Shehata Gamal
  • 98,760
  • 8
  • 65
  • 87
1

use Swift Unicode escape sequence concept:

let emojiString = "\u{1F4C4}"

and if you want to get all emoji's Unicode then try this

let emojiRanges = [
    0x1F601...0x1F64F,
    0x2702...0x27B0,
    0x1F680...0x1F6C0,
    0x1F170...0x1F251
]

for range in emojiRanges {
    for i in range {
        var c = String(UnicodeScalar(i))
        print(c)
    }
}
Mahesh Dangar
  • 806
  • 5
  • 11