show video with Text Selection: Programmatic access to and control of text selection within text editing controls.
Asked on 06/18/2025
1 search
To learn about programmatic access to and control of text selection within text editing controls in SwiftUI, you can refer to the session titled "What’s new in SwiftUI" from WWDC 2024. This session discusses how SwiftUI now offers programmatic access to text selection, allowing you to manage selection and read properties such as selected ranges. You can find this information in the segment starting at 15:06.

What’s new in SwiftUI
Learn how you can use SwiftUI to build great apps for any Apple platform. Explore a fresh new look and feel for tabs and documents on iPadOS. Improve your window management with new windowing APIs, and gain more control over immersive spaces and volumes in your visionOS apps. We’ll also take you through other exciting refinements that help you make expressive charts, customize and layout text, and so much more.

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.

Get started with Writing Tools
Learn how Writing Tools help users proofread, rewrite, and transform text in your app. Get the details on how Writing Tools interact with your app so users can refine what they have written in any text view. Understand how text is retrieved and processed, and how to support Writing Tools in custom text views.