Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enter unicode characters in a UILabel in Interface Builder?

I would like to display a unicode character (the speaker symbol U+1F50A) in label. Is it possible to enter this symbol in Interface Builder?

like image 706
ragnarius Avatar asked Jun 17 '12 09:06

ragnarius


People also ask

How do you input Unicode?

To insert a Unicode character, type the character code, press ALT, and then press X. For example, to type a dollar symbol ($), type 0024, press ALT, and then press X.

How do I use Unicode in Xcode?

in xcode? Use the control command space keyboard shortcut, or choose Edit → Emoji & Symbols from the menu bar. You can also use "\u{203C}\u{FE0F}" instead of "‼️" in a string or character literal.

How to use unicode in ios?

To install a Unicode keyboard on your iPhone or iPad, launch the App Store and download the free UniChar app. Then launch Settings, General, Keyboard, Keyboards, Add New Keyboard…, and select UniChar from the options.


2 Answers

Yes, you can click "Edit" > "Special Characters…" — there you can find all unicode characters (including the emoji) and copy/paste them where you set the label text in Interface Builder.

EDIT: In Xcode 6 it's "Edit" > "Emoji & Characters"

Xcode 7+: "Edit" > "Emoji & Symbols"

like image 170
graver Avatar answered Sep 28 '22 22:09

graver


For those who tried doing it programmatically, but failed, just use this:

label.text = @"\U0001F50A"; 
like image 45
JohnVanDijk Avatar answered Sep 28 '22 22:09

JohnVanDijk