Contents

Building rich SwiftUI text experiences

Build an editor for formatted text using SwiftUI text editor views and attributed strings.

Overview

You can follow along with the code written in the WWDC25 session, learning how to upgrade TextEditor to rich text, build custom controls, and constrain the formatting options the editor provides.

After the code-along, you can learn more about how to persist rich text using SwiftData, and how to export rich text documents using the Transferable protocol.

Configure the sample code project

To configure the sample code project, do the following in Xcode:

  1. Open the sample with the latest version of Xcode.

  2. Set the developer team to let Xcode automatically manage the provisioning profile. For more information, see Preparing your app for distribution and Preparing your app for distribution.

See Also

Getting text input