How can I draw a text on the side of a UITextview

Asked on 06/19/2025

1 search

To draw text on the side of a UITextView, you can utilize the new text formatting features introduced in UIKit. Specifically, you can customize the text formatting panel by setting a custom UITextFormattingViewControllerConfiguration using the UITextView's new text formatting configuration property. This allows you to tailor the presentation of the panel and apply text highlight styles and color schemes.

For more detailed information on text improvements in UIKit, you can refer to the session What’s new in UIKit (16:14).

If you are interested in custom text drawing possibilities, you might also want to explore the session Create custom visual effects with SwiftUI (12:49), which discusses customizing how SwiftUI text is drawn, including animation and custom text rendering.

How can I draw a text on the side of a UITextview | Ask WWDC