---
title: Building rich SwiftUI text experiences
framework: swiftui
role: sampleCode
role_heading: Sample Code
path: sample-code/swiftui/building-rich-swiftui-text-experiences
---

# Building rich SwiftUI text experiences

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

## Overview

Overview note: This sample code project is associated with WWDC25 session 280: Code-along: Cook up a rich text experience in SwiftUI with AttributedString. 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: Open the sample with the latest version of Xcode. 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

- [TextField](swiftui/textfield.md)
- [textFieldStyle(_:)](swiftui/view/textfieldstyle(_:).md)
- [SecureField](swiftui/securefield.md)
- [TextEditor](swiftui/texteditor.md)
