App Services / 23:46

Elevate your app’s text experience with TextKit

App ServicesSwiftUI & UI Frameworksiosipadosmacostvosvisionoswatchos

Key Points

  • Shows how to combine the convenience of built-in text views with the control of TextKit.
  • Also covers TextKit architecture plus caching and reuse policies for text attachments.
  • To get the most out of this session, watch "Meet TextKit 2" from WWDC21 and "What New in TextKit and text views" from WWDC22.
  • The session moves through TextKit architecture, What's new in TextKit, Extending framework text views, Example: Code editor with line numbers, Example: Collapsible recipe sections, Text attachments and view provider reuse.
  • Key concepts include TextKit, UITextView, NSTextView, WWDC21, WWDC22, SwiftUI, UIKit, AppKit.
  • Platform coverage: ios, ipados, macos, tvos, visionos, watchos.

Condensed Flow

01

TextKit architecture:

Focuses on TextKit, NSTextContentStorage, NSTextLayoutManager, NSTextViewportLayoutController.

02

What's new in TextKit:

Focuses on TextKit.

03

Extending framework text views:

Focuses on UIKit, UITextView, AppKit, NSTextView.

04

Example: Code editor with line numbers:

Focuses on ContainerView, UITextView, UIView, NSTextView.

05

Example: Collapsible recipe sections:

Focuses on NSTextContentManager, NSTextContentStorage, NSTextElement, NSTextParagraph.

06

Text attachments and view provider reuse:

Focuses on UITextView.

More Detail

Additional details

  • Detailed flow: TextKit architecture -> What's new in TextKit -> Extending framework text views -> Example: Code editor with line numbers -> Example: Collapsible recipe sections -> Text attachments and view provider reuse.
  • APIs and concepts to recognize: TextKit, UITextView, NSTextView, WWDC21, WWDC22, SwiftUI, UIKit, AppKit, TextEditor, NSTextContentStorage, NSTextLayoutManager, NSTextViewportLayoutController.
  • Implementation focus: NSTextContentStorage, NSTextLayoutManager, NSTextViewportLayoutController, NSTextLayoutFragment, UIView, NSView, CALayer, UITextView, NSTextView, NSTextViewportLayoutControllerDelegate.

Resources