In iOS 7, several of the CGContext text drawing functions were deprecated in favor of Core Text:
Deprecated CGContext Functions
Sometimes Apple suggests specific alternatives to deprecated functions (e.g. "use x instead") but in this case, "x" is simply "Core Text", which isn't all that specific.
So, if I'm just in -drawRect:
and I've got my CGContextRef
and I'm ready to call CGContextShowGlyphsAtPoint()
, what do I do instead? What's the best practice, and what's the simplest Core Text replacement that doesn't require refactoring any drawing code beyond that call (if such a thing exists)?
Bonus points for an answer that concisely answers this for each of the deprecated text functions on that page—I'm most interested in CGContextShowGlyphsAtPoint()
, but this could serve as a good reference for others seeking alternatives to any of those functions.
CTFontDrawGlyphs
a try. You'll probably have to do some calculations, but this seems the best method that I've seen. – Carman