Cherif Cherif - 5 months ago 30
Swift Question

How to include emoticons in Swift string?

Here is a pretty good article that references iOS emoticons and their code. For example

\ue008
for the small camera.

I tried this in my code :

var myText: String = "\ue008"


This is not accepted by xCode. How to include it ?

Answer

That's from swift documentation:

let dollarSign = "\u{24}"        // $,  Unicode scalar U+0024
let blackHeart = "\u{2665}"      // ♥,  Unicode scalar U+2665
let sparklingHeart = "\u{1F496}" //