kodecocodes / m3-wti-materials

The projects and the assets that accompany the Writing Tools module
Apache License 2.0
0 stars 0 forks source link

Add a meaningful custom view demonstrating how to work with Writing Tools #1

Open SuzGupta opened 2 months ago

SuzGupta commented 2 months ago

@drmarkpowell can you help with this?

Here's how to integrate Writing Tools with a custom text view, in other words, what we want to teach (but we start with a skeleton view and then guide them in adding the Writing Tools support:

On iOS and iPadOS, as long as your custom text view adopts UITextInteraction, you’ll get Writing Tools in the callout bar or context menu for free. If you can’t use UITextInteraction, you can also adopt UITextSelectionDisplayInteraction with UIEditMenuInteraction. Under the hood, Writing Tools relies on the UITextInput protocol to read and write the text and to anchor the popover.

For more about text interactions, check out some amazing previous WWDC talks.

For text views that don’t use text interactions, we’ve added a new optional property isEditable in UITextInput protocol. Adopt that to indicate if your text view supports editing.

SuzGupta commented 2 months ago

I think maybe this is the Skills View?

SuzGupta commented 2 months ago

Relevant LOs from Lesson 3: