<!--
{
  "documentType" : "article",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/text-display",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Text Display"
}
-->

# Text Display

Display text and check spelling.

## Discussion

In most cases, you can lay out your app’s text using the [`NSTextField`](/documentation/AppKit/NSTextField) or [`NSTextView`](/documentation/AppKit/NSTextView) classes (or their subclasses). Use the [`NSTextField`](/documentation/AppKit/NSTextField) class to add either a label or a simple text input. Use the [`NSTextView`](/documentation/AppKit/NSTextView) class to provide more comprehensive layout and editing features for larger bodies of text.

For example, [`NSTextView`](/documentation/AppKit/NSTextView) supports rich text, attachments (graphics, file, and other), input management and key binding, and marked text attributes. [`NSTextView`](/documentation/AppKit/NSTextView) works with the font panel and menu, rulers and paragraph styles, the Services facility (for example, the spell-checking service), and the pasteboard.

[`NSTextView`](/documentation/AppKit/NSTextView) also allows customizing through delegation and notifications—you rarely need to subclass [`NSTextView`](/documentation/AppKit/NSTextView). You rarely create instances of [`NSTextView`](/documentation/AppKit/NSTextView) programmatically either, because objects on Interface Builder’s palettes, such as [`NSTextField`](/documentation/AppKit/NSTextField), [`NSForm`](/documentation/AppKit/NSForm), and [`NSScrollView`](/documentation/AppKit/NSScrollView), already contain [`NSTextView`](/documentation/AppKit/NSTextView) objects.

For even more powerful and more creative text manipulation (such as displaying text in a circle) see [TextKit](/documentation/AppKit/textkit).

### Spell-checking

The <doc://com.apple.documentation/documentation/Foundation/NSSpellServer> class lets you define a spell-checking service and provide it as a service to other apps. To connect your app to a spell-checking service, use the [`NSSpellChecker`](/documentation/AppKit/NSSpellChecker) class. The [`NSIgnoreMisspelledWords`](/documentation/AppKit/NSIgnoreMisspelledWords) and [`NSChangeSpelling`](/documentation/AppKit/NSChangeSpelling) protocols support the spell-checking mechanism.

## Topics

### Text views

[`NSTextField`](/documentation/AppKit/NSTextField)

Text the user can select or edit to send an action message to a target when the user presses the Return key.

[`NSTextFieldDelegate`](/documentation/AppKit/NSTextFieldDelegate)

A protocol that a text field delegate can use to control its field editor action menu.

[`NSTextView`](/documentation/AppKit/NSTextView)

A view that draws text and handles user interactions with that text.

[`NSTextViewDelegate`](/documentation/AppKit/NSTextViewDelegate)

A set of optional methods that text view delegates can use to manage selection, set text attributes, work with the spell checker, and more.

[`NSTextDelegate`](/documentation/AppKit/NSTextDelegate)

A set of optional methods implemented by the delegate of an [`NSText`](/documentation/AppKit/NSText) object to edit text and change text formats.

[`NSText`](/documentation/AppKit/NSText)

The most general programmatic interface for objects that manage text.

### Text input

[Adopting the system text cursor in custom text views](/documentation/AppKit/adopting-the-system-text-cursor-in-custom-text-views)

Incorporate the system text cursor into your custom text UI in AppKit.

[`NSTextInputContext`](/documentation/AppKit/NSTextInputContext)

An object that represents the Cocoa text input system.

[`NSTextInputClient`](/documentation/AppKit/NSTextInputClient)

A set of methods that text views need to implement to interact properly with the text input management system.

[`NSTextAlternatives`](/documentation/AppKit/NSTextAlternatives)

A list of alternative strings for a piece of text.

[`NSTextContent`](/documentation/AppKit/NSTextContent)

A protocol that describes specific kinds of input content types.

[`NSTextInsertionIndicator`](/documentation/AppKit/NSTextInsertionIndicator)

A view that represents the insertion indicator in text.

[`DisplayMode`](/documentation/AppKit/NSTextInsertionIndicator/DisplayMode-swift.enum)

Constants that determine how to display the system text cursor in a custom text UI.

[`AutomaticModeOptions`](/documentation/AppKit/NSTextInsertionIndicator/AutomaticModeOptions-swift.struct)

Options that affect the automatic display mode.

### Text-checking

[`NSTextCheckingController`](/documentation/AppKit/NSTextCheckingController)

[`NSTextCheckingClient`](/documentation/AppKit/NSTextCheckingClient)

[`NSTextInputTraits`](/documentation/AppKit/NSTextInputTraits)

[`NSTextInputTraitType`](/documentation/AppKit/NSTextInputTraitType)

### Spell-checking

[`NSSpellChecker`](/documentation/AppKit/NSSpellChecker)

An interface to the Cocoa spell-checking service.

[`NSChangeSpelling`](/documentation/AppKit/NSChangeSpelling)

A protocol that responder objects can implement to correct a misspelled word.

[`NSIgnoreMisspelledWords`](/documentation/AppKit/NSIgnoreMisspelledWords)

A protocol that enables the Ignore button in the Spelling panel to function properly.

### Deprecated

[`NSTextInput`](/documentation/AppKit/NSTextInput)

A set of methods that text views need to implement to interact properly with the text input management system.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)