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

前端 未结 5 1657
南旧
南旧 2020-12-13 23:32

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?

5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-13 23:37

    It's fun why few people knew this. You can enter Unicode-symbols directly by holding "Option" and entering hex digit. All you need: (Sierra example) goto "Preference -> Keyboards -> Input Sources" and search for "Unicode Hex". It should appears under "Others" section. Next add it and then you be able enter Unicode-char anywhere just selecting this input source.

    For example: ✓ = (Alt+2713), € - (20ac), etc. Most interesting section from 2100 to 2800. Full list you can found here - Unicode table

    P.S.: This method sutable only for four-digit Unicodes

提交回复
热议问题