what's new in attributedstring before iOS 2026
Asked on 06/24/2025
1 search
Before iOS 2026, several updates and enhancements were made to AttributedString
in SwiftUI, as discussed in various WWDC sessions:
-
Rich Text Editing in SwiftUI: The SwiftUI Text Editor now supports
AttributedString
, allowing for rich text editing. You can pass a binding to anAttributedString
into the Text Editor, enabling features like boldness, italics, underline, strikethrough, custom fonts, and more. This was highlighted in the Platforms State of the Union. -
Text Selection and Ranges: In iOS 18,
UITextView
had a single selected range property, which was limited in handling bidirectional text. By iOS 26, a new property calledselectedRanges
was introduced to represent an array of non-contiguous NS ranges, improving text selection accuracy. This was discussed in the session Enhance your app’s multilingual experience. -
Custom Attributes and Formatting: The
AttributedString
in SwiftUI allows for custom attributes and formatting definitions. You can define which attributes your text editor responds to and what values they might have, as demonstrated in the session Code-along: Cook up a rich text experience in SwiftUI with AttributedString. -
Text Highlighting: New attributes like
texthighlight
were introduced to control text highlighting, which can be customized using the app's accent color or predefined color schemes. This feature was part of the updates in What’s new in AppKit.
These updates collectively enhance the capabilities of AttributedString
in SwiftUI, providing developers with more tools to create rich text experiences in their apps.

Enhance your app’s multilingual experience
Create a seamless experience for anyone who uses multiple languages. Learn how Language Discovery allows you to optimize your app using a person’s preferred languages. Explore advances in support for right-to-left languages, including Natural Selection for selecting multiple ranges in bidirectional text. We’ll also cover best practices for supporting multilingual scenarios in your app.

What’s new in SwiftUI
Learn what’s new in SwiftUI to build great apps for any Apple platform. We’ll explore how to give your app a brand new look and feel with Liquid Glass. Discover how to boost performance with framework enhancements and new instruments, and integrate advanced capabilities like web content and rich text editing. We’ll also show you how SwiftUI is expanding to more places, including laying out views in three dimensions.

Code-along: Cook up a rich text experience in SwiftUI with AttributedString
Learn how to build a rich text experience with SwiftUI’s TextEditor API and AttributedString. Discover how you can enable rich text editing, build custom controls that manipulate the contents of your editor, and customize the formatting options available. Explore advanced capabilities of AttributedString that help you craft the best text editing experiences.