8

I would like to get a down arrow to display inside a UILabel. Specifically ⬇ Unicode: U+2B07. This is show sort order on a column header.

I have seen the code to get unicode characters to display and when I use it for the symbol above it doesn't display as expected but rather comes up with a blue down arrow with gloss.

Has anyone seen this?

Cœur
  • 37,241
  • 25
  • 195
  • 267
kyleplattner
  • 633
  • 1
  • 6
  • 16
  • any chance you could provide the code here to display Unicode characters? I'm interested in knowing how to do that, many thanks. – bennythemink Mar 27 '13 at 23:37

2 Answers2

14

Displaying some characters as "Emojis" is a feature which is e.g. (controversially) discussed here: https://devforums.apple.com/message/487463#487463 (requires Apple Developer login). This feature was introduced in iOS 6.

A solution (from https://stackoverflow.com/a/13836045/1187415) is to append the Unicode "Variation selector" U+FE0E, e.g.

self.myLabel.text = @"\u2B07\uFE0E";
// or:
self.myLabel.text = @"⬇\uFE0E";

Note that on iOS <= 5.x, the Variation selector is not necessary and must not be used, because iOS 5 would display it as a box.

In Swift it would be

myLabel.text = "⬇\u{FE0E}"
Community
  • 1
  • 1
Martin R
  • 529,903
  • 94
  • 1,240
  • 1,382
8

If you're seeing the blue arrow with gloss, you have the right character, but it's showing one of the emoji-style characters. Try changing the font of your UILabel to something like Arial Unicode MS.

Edit After a little testing, it looks like changing the font doesn't actually work. It keeps displaying the glossy arrow. It's probably better to go with the suggestion of the other answer and use a different glyph, like \u2193, which does work:

[nameLabel setText:@"\u2193"];

enter image description here

nevan king
  • 112,709
  • 45
  • 203
  • 241