3 Replies
      Latest reply: Sep 27, 2016 9:39 AM by Albinus RSS
      Albinus Level 1 Level 1 (0 points)

        I can't figure out how to draw a text string in a CGContext. According to the documentation, every method that has a string parameter has been deprecated. But CGContext still has a textPosition property.

        • Re: CGContext text drawing in Swift 3
          eskimo Apple Staff Apple Staff (6,665 points)

          Drawing text with CG is almost never the right option.  For this reason, routines like CGContextShowGlyphs have 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"