how are the new text view apis used

Asked on 06/15/2025

1 search

The new text view APIs introduced at WWDC are designed to enhance text editing experiences across different Apple platforms. Here are some key features and how they are used:

  1. Text Highlighting: In UIKit, the new text view APIs allow for text highlighting using texthighlightstyle and texthighlight color scheme. There are predefined color schemes, and you can customize the formatting panel using the uitextview's new text formatting configuration property. This is discussed in the What’s new in UIKit session.

  2. Writing Tools: The Writing Tools feature provides advanced text editing capabilities, including inline editing, proofreading, and composition support. New delegate methods and properties are introduced for uitextview and NXT view to manage these tools. This is covered in the Get started with Writing Tools session.

  3. Rich Text Editing in SwiftUI: SwiftUI now supports rich text editing with AttributedString. You can pass a binding to an AttributedString into a Text Editor to enable rich text features. This is highlighted in the What’s new in SwiftUI session.

  4. Custom Text Engines: For custom text engines, the Writing Tools Coordinator API allows for managing interactions between your view and writing tools. This includes handling animations, proofreading marks, and state changes. This is detailed in the Dive deeper into Writing Tools session.

These APIs provide a robust framework for enhancing text editing capabilities in your apps, whether you're using UIKit, SwiftUI, or custom text engines.