Drawing text with CG is almost never the right option. For this reason, routines like
CGContextShowGlyphshave been deprecated in Objective-C and aren’t available in Swift. The only exception is
CGContextShowGlyphsAtPositions, but even that’s imported into Swift with a double underscore prefix (
__showGlyphs(_:atPositions:count:)). The recommended alternative is Core Text.
Share and Enjoy
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"
After much googling I finally got this from some example code:
myString.draw(at: CGPoint(x: 0, y: lineOffset), withAttributes: [:])
Where would I look for these methods in the documentation? What API are they from?
I found the documentation, under NSString in Foundation. I was sure it would be in UIKit somewhere.