---
title: Using TextKit 2 to interact with text
framework: uikit
role: sampleCode
role_heading: Sample Code
path: sample-code/uikit/using-textkit-2-to-interact-with-text
---

# Using TextKit 2 to interact with text

Interact with text by managing text selection and inserting custom text elements.

## Overview

Overview note: This sample code project is associated with WWDC21 session 10061: Meet TextKit 2.

## See Also

### Layout

- [Display text with a custom layout](uikit/display-text-with-a-custom-layout.md)
- [Managing viewport layout and attachment reuse in text views](uikit/managing-viewport-layout-and-attachment-reuse-in-a-text-view-subclass.md)
- [NSTextLayoutManager](uikit/nstextlayoutmanager.md)
- [NSTextContainer](uikit/nstextcontainer.md)
- [NSTextLayoutFragment](uikit/nstextlayoutfragment.md)
- [NSTextLineFragment](uikit/nstextlinefragment.md)
- [NSTextViewportLayoutController](uikit/nstextviewportlayoutcontroller.md)
- [NSTextViewportRenderingSurface](uikit/nstextviewportrenderingsurface.md)
- [NSTextViewportRenderingSurfaceKey](uikit/nstextviewportrenderingsurfacekey.md)
- [NSTextLayoutOrientationProvider](uikit/nstextlayoutorientationprovider.md)
