MyLocation Draw text on the UIView (HUD)

Hi,

I followed example code to draw the text on the view using: text.draw(…), however, I noticed that there isn’t auto-complement for text. I couldn’t find the draw function from the menu, could you explain this?

The draw() method is a method of the NSString class, which the swift String class “bridges to”, which more or less means they are the same thing. But you don’t get the draw() method auto-complete unless you make the text explicitly NSString:

    (text as NSString).draw(at: CGPoint, withAttributes: [NSAttributedStringKey : Any]?)

This topic was automatically closed after 166 days. New replies are no longer allowed.