Disabling emoji characters with Unicode variants / by Paulo Fierro

I'm currently working on an internal iOS app and while I was working on putting together the About screen I ran into an issue where unicode characters in a UILabel were being displayed as emoji by iOS. While this is kind of awesome, its not really what I was going for.

So my code:

label.text = @"Made with ❤ by jadehopper ltd.";

results in:

madewithemoji.png

To disable the emoji character we have to tell iOS to use the variant of this character. In order to do this we change the label text to:

label.text = @"Made with ❤\U0000FE0E by jadehopper ltd.";

which results in:

madewithnoemoji.png

Much better! If you want to read up on Unicode and its variants check this out.

 

Update Jan 20, 2015

Recently I tried to do this in Swift and it didn't quite work. The trick is to set the text as the following:

label.text = "Made with ❤\u{0000FE0E} by jadehopper ltd."