What’s new in TextKit?

Asked on 08/02/2024

1 search

TextKit has seen several updates and enhancements across different sessions at WWDC 2024. Here are some of the key highlights:

  1. Text Highlighting in UIKit:

    • UIKit now supports a new text highlight feature. This is achieved by applying two new properties: texthighlightstyle for the range of text that should be highlighted and texthighlight color scheme for the color used to render the highlight. There are five predefined color schemes in addition to the default, which uses the tint color.
    • You can customize the available controls and layout of the formatting panel by setting a custom UITextFormattingViewControllerConfiguration using UITextView's new text formatting configuration property.
    • For more details, you can refer to the session What’s new in UIKit.
  2. Writing Tools Integration:

    • Writing tools have been integrated into both UIKit and AppKit, providing advanced text editing experiences. This includes inline editing, proofreading, and composition support.
    • New delegate methods and properties have been introduced to manage writing tool sessions, such as isWritingToolsActive and methods to handle the beginning and end of writing tool sessions.
    • For more details, you can refer to the session Get started with Writing Tools.
  3. TextKit 2 Enhancements:

    • TextKit 2 continues to improve text rendering and layout, ensuring that text in any of the user's preferred languages can render correctly in any app.
    • For more details, you can refer to the session Build multilingual-ready apps.
  4. Text Renderer API in macOS:

    • A new text renderer API has been introduced in macOS, enabling a whole new level of visual effects and playful animations.
    • For more details, you can refer to the session Platforms State of the Union.

These updates provide developers with more tools and flexibility to enhance text handling and rendering in their applications.