what can developers do with writing tools

Asked on 07/31/2024

1 search

Developers can leverage the new suite of features called Writing Tools to enhance text fields across various apps. Here are some key functionalities and integration points:

  1. Proofreading and Rewriting: Writing Tools help users proofread, rewrite, or transform text within text views. Suggestions appear in-line, making it easy to review and integrate changes quickly and seamlessly in any native text field (Get started with Writing Tools).

  2. Rich Text Support: Writing Tools fully support rich text by using attributed strings, preserving attributes like styles, links, and attachments as long as the relevant text remains in the rewritten text (Get started with Writing Tools).

  3. List and Table Transformations: If the text view supports lists and tables, Writing Tools can transform text into lists or tables while preserving formatting (Get started with Writing Tools).

  4. Integration with Standard UI Frameworks: If you are using standard UI frameworks like UITextView, NSTextView, or WKWebView, Writing Tools will work automatically. For full functionality, ensure you are using the latest text storage capabilities (Get started with Writing Tools).

  5. Custom Text Views: For custom text views, developers can get a basic experience for free by adopting UITextInteraction or UITextSelectionDisplayInteraction. This allows Writing Tools to appear in the color bar or context menu (Get started with Writing Tools).

  6. Delegate Methods and Properties: New delegate methods and properties are available to control app states during a Writing Tools session. For example, you can pause syncing or avoid accidental editing while Writing Tools is active (Get started with Writing Tools).

  7. Ignoring Specific Text Ranges: Developers can specify ranges of text to be ignored by Writing Tools, such as code blocks or quoted content, using new delegate methods in UITextFieldDelegate and NSTextViewDelegate (Get started with Writing Tools).

For more detailed information, you can refer to the session Get started with Writing Tools.