Introduction

Heads up... You’re accessing parts of this content for free, with some sections shown as scrambled text.

Heads up... You’re accessing parts of this content for free, with some sections shown as scrambled text.

Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.

Unlock now

Creating custom text views gives you control over the user experience, but requires managing behaviors typically provided by UIKit. Fortunately, Writing Tools can still work with your custom text views, allowing you to enhance text interactions in your app.

You might want to create a custom text view instead of using UITextView if:

  • You need unique text formatting or styles. Custom views let you control how text looks, such as adding special fonts, images, or effects.
  • Your app requires special text interactions, like input methods that the default text views don’t support.
  • Performance is a priority, like to optimize text rendering and memory usage for apps with large documents or complex content.

In this lesson, you’ll see how to get Writing Tools working with custom text views built on UITextInput. You can also make custom text views that can adopt the Writing Tools via the UITextSelectionDisplayInteraction and UIEditMenuInteraction protocols, and even with text views that don’t use text interactions. These additional techniques are beyond the scope of this course, however.

See forum comments
Download course materials from Github
Previous: Foreword Next: Instruction