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
This content was released on Oct 16 2024. The official support period is 6-months
from this date.
Learn how your custom views can offer a Writing Tools experience.
Download course materials from Github
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress,
bookmark, personalise your learner profile and more!
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.