April 2015
Intermediate to advanced
556 pages
17h 47m
English
Both NSString and NSAttributedString have methods that cause them to be drawn onto a view. NSAttributedString has the following methods:
func drawAtPoint(point: NSPoint)
Draws the attributed string. point is the lower-left corner of the string.
func drawInRect(rect: NSRect)
Draws the attributed string; all drawing occurs inside rect. If rect is too small for the string to fit, the drawing is clipped to fit inside rect.
var size: NSSize { get }
Returns the size in points that the attributed string would be if drawn.
NSString has analogous methods. With NSString, you need to supply a dictionary of attributes to be applied for the entire string.
func drawAtPoint(point: ...
Read now
Unlock full access