How to enter Unicode characters in UILabel in interface builder?

I would like to display the unicode character (speaker character U + 1F50A) in the label. Can this character be entered in Interface Builder?

+47
ios iphone unicode utf-8 interface-builder
Jun 17 2018-12-12T00:
source share
5 answers

Yes, you can click EditSpecial Characters... - there you can find all Unicode characters (including emoji) and copy / paste them where you set the label text in InterfaceBuilder .

EDIT : Starting with Xcode6 it is Editing> Emoji and Symbols

+87
Jun 17 '12 at 10:01
source share

For those who tried to do this programmatically but failed, just use this:

 label.text = @"\U0001F50A"; 
+18
Feb 07 '14 at 5:40
source share

Do it programmatically.

Declare an IBOutlet for the label using the NSString type:

 // UTF-8 Hexadecimal Encoding NSString *myString = [NSString stringWithUTF8String:"0xF09F948A"]; myLabel.text = myString; 

Also consider this question.

+15
Jun 17 '12 at 10:01
source share

It is fun why few people knew about it. You can enter Unicode characters directly by holding "Option" and entering the sixth digit. All you need is: (Sierra example) goto "Preference → Keyboards → Input Sources" and search for "Unicode Hex". It should appear in the "Other" section. Then add it, and then you can enter Unicode-char anywhere, just by selecting this input source.

For example: ✓ = (Alt + 2713), € - (20ac), etc. The most interesting section is from 2100 to 2800. You can find the full list here - Unicode table

PS: This method can only be used for four-digit Unicodes

+3
Oct 15 '16 at 14:13
source share

In Xcode 8 / Swift 3, the easiest way is to use unicode escape code:

 let a = "\u{1F50A}" 
+1
Aug 20 '17 at 19:34 on
source share



All Articles