The most general programmatic interface for objects that manage text.
SDK
- macOS 10.0+
Framework
- App
Kit
Declaration
@interface NSText : NSView
Overview
NSText
draws text for user interface objects, provides text editing capabilities, and controls text attributes such as type size, font, and color.
NSText
initialization creates an instance of a concrete subclass, such as NSText
(generically called a text object). In general, you're more likely to use the NSText
subclass, because it extends the interface declared by NSText
and provides much more sophisticated functionality than that declared in NSText
.
AppKit uses text objects wherever text appears in interface objects. For example, a text object draws the title of a window, the commands in a menu, the title of a button, and the items in a browser. Your app can also create text objects for its own purposes.