10

Setting the title of a uibutton to u25C0 causes it to have a blue background in iOS5 but not in iOS4.3.

Strangely enough setting the title to u25C2, 2 characters a head in line, appears as expected. Go fig. I will be attaching an image later.

As a side note is this blue button currently in use in any Apple apps?

Thanks.

enter image description here

Left : iOS 5 Right : iOS 3.2

This was done by setting the title to the unicode character stated earlier.

Yogurt
  • 2,913
  • 2
  • 32
  • 63

3 Answers3

9

You can try to use Unicode6.1's variation selector. For about Emoji, adding "\U0000FE0E" to specify non-coloured glyph.

For example, for about left-triangle(U+25C0), you can specify like @"\U000025C0\U0000FE0E", and that changed glyph from Apple Color Emoji style to non-colored plain emoji, at least on iOS6 simulator on Mountain Lion.

Swift 4.0

let glyph = "\u{000025C0}\u{0000FE0E}"
Laszlo
  • 2,803
  • 2
  • 28
  • 33
Tsuneo Yoshioka
  • 7,504
  • 4
  • 36
  • 32
  • After testing this does not appear to work with iOS5, instead the modifier is shown as a character but it worked fine with iOS6 – Peter Oct 19 '12 at 13:12
5

You need to set the font appropriately. The blue icon you're seeing is U+25C0 in the Apple Color Emoji font. I'm not sure what other fonts on iOS include the symbol you want, but if you find that font and set it explicitly then it should render the icon you want.

Lily Ballard
  • 182,031
  • 33
  • 381
  • 347
  • Damn, it seems like the emoji characters are used everywhere. I searched around and I couldn't find any tools to look at the iOS fonts, unfortunately. I tried what you suggested but it hasn't worked at least with the fonts that I have tried. I'm looking for a way to use the old characters rather than the emojis. It seems like other people are having problems with these emojis as well, with no solution posted, as far as I can tell. I'll update this post if I find anything. – Yogurt Dec 10 '11 at 01:16
  • 1
    @DDT_DZ: Try setting the font to Hiragino Mincho ProN – Lily Ballard Dec 10 '11 at 01:45
  • Thank you again. I've tested it and it works. How did you find out that this was the correct font? – Yogurt Dec 10 '11 at 02:34
  • I had to add a slight inset to the top of the title to get it to look right. Is this just a characteristic of the font? – Yogurt Dec 10 '11 at 02:51
  • @DDT_DZ: It's a font that I verified a) had the glyph, and b) was present on iOS. It's possible there's another font on iOS that has this glyph as well that's better for your purposes. You'll just have to experiment. You can find a list of fonts on iOS at http://iosfonts.com/, and you can experiment by creating a web page that contains this glyph and using CSS to set the font family to each of these fonts in turn until you find the one you like. – Lily Ballard Dec 10 '11 at 04:38
  • Thank you. I see. I think I now know how you found out Hiragino Mincho Pron had the glyph. I copy and pasted the glyph in textEdit and it drew in Hiragino Mincho Pron when it was originally helvetica. You've been very helpful. I have one more question about fonts and that's it I promise :) Do all Helvetica fonts draw the U+25C0 in that emoji style? Or is this just an Apple thing? Or do most of them not draw the character at all? Was there a standard that changed after iOS 4.3 that said Helvetica no longer had U+25C0? – Yogurt Dec 12 '11 at 22:27
  • @DDT_DZ: Any font that doesn't contain the glyph (which is most fonts) don't draw anything. However, the text systems in OS X and iOS will fall back to another font that *does* contain the glyph if the chosen one doesn't. The font fallback behavior tries to match font characteristics as closely as possible, although the fallback behavior is much more primitive on iOS than it is on OS X. In any case, relying on font fallbacks is what caused this issue in the first place, since a new font was added that ended up higher in the font fallback priority list. – Lily Ballard Dec 12 '11 at 22:31
  • 1
    @DDT_DZ: Or to clarify: Helvetica never had this glyph to begin with. What you were seeing was another font that the system had picked using the font fallback behavior. However, the Apple Color Emoji font ended up higher in the font fallback list when it was introduced in iOS 5, thus changing the font that the system fell back to in order to draw the glyph. – Lily Ballard Dec 12 '11 at 22:32
  • Not having luck with Hiragino Mincho ProN in a UITableViewCell… – David Dunham Jun 12 '12 at 18:56
  • 1
    Hiragino Mincho ProN worked for me with this problem in iOS 7 . For what I wanted, on ios6 i needed to use system font. – Tom Andersen Oct 07 '13 at 15:52
3

Just found how to achieve this without code. Open Symbols&Emoji panel by clicking near your country flag in top right corner of OSX screen.

enter image description here

  1. Type symbol you wanna find
  2. Double-click on symbol you found
  3. You will see it appear in text filed
  4. Press Enter and you will see emoji in Xcode IB

enter image description here

  1. Type "variation" keyword in search field
  2. Double click on variation selector symbol
  3. Sure it is "VARIATION SELECTOR-15" exactly
  4. Nothing will changed in textfield (don't worry)
  5. After pressing Enter Xcode IB will changed to flat emoji!
k06a
  • 17,755
  • 10
  • 70
  • 110