dynamic UITextView
Generated on 10/12/2024
1 search
In the WWDC 2024 session titled "Get started with Writing Tools," several new features and APIs related to UITextView
were introduced. These include:
-
New Delegate Methods and Properties: New delegate methods for
UITextView
andNSTextView
have been introduced to manage writing tools. These methods help in preparing app states when writing tools are active, such as pausing syncing or avoiding accidental editing. Additionally, a new propertyisWritingToolsActive
is available to check if a writing tool session is active. -
Handling Long Text: When dealing with long text, rewritten text may be delivered in chunks, and animations are applied to indicate processing. Users can switch between original and rewritten text for proofreading, and changes are automatically applied to the text field.
-
Customizing Writing Tools Behavior: You can customize the behavior of writing tools using new text input traits APIs. Options are available to specify if your
UITextView
supports rich text or tables. -
Custom Text Views: For custom text views, adopting
UITextInteraction
orUITextSelectionDisplayInteraction
can provide a basic writing tools experience. TheUITextInput
protocol is used under the hood for text interactions. -
Protecting Ranges: New delegate methods allow you to specify text ranges that writing tools should ignore, such as code blocks or quoted content.
For more detailed information, you can refer to the session Get started with Writing Tools (07:03) which covers controlling behavior, and Custom text views (09:03) for custom text view implementations.
What’s new in UIKit
Explore everything new in UIKit, including tab and document launch experiences, transitions, and text and input changes. We’ll also discuss better-than-ever interoperability between UIKit and SwiftUI animations and gestures, as well as general improvements throughout UIKit.
Build multilingual-ready apps
Ensure your app works properly and effectively for multilingual users. Learn best practices for text input, display, search, and formatting. Get details on typing in multiple languages without switching between keyboards. And find out how the latest advances in the String Catalog can make localization even easier.
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.