what's new with the TextEditor

Asked on 06/11/2025

1 search

The new features for the TextEditor in SwiftUI, as presented at WWDC, include support for rich text editing using AttributedString. This allows for a wide range of text styling options such as boldness, italics, underline, strikethrough, custom fonts, point size, foreground and background colors, kerning, tracking, baseline offset, and more. The TextEditor can now handle dark mode and dynamic type, and it supports paragraph styling, line height, text alignment, and base writing direction as independent attributes.

Additionally, you can customize the text editor by using the Attributed Text Formatting Definition Protocol to define which attributes are available and what values they might have. This allows for a more tailored text editing experience, where you can constrain attributes and apply custom formatting rules.

For more detailed information, you can refer to the session Code-along: Cook up a rich text experience in SwiftUI with AttributedString (00:01:15).