Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
SuzGupta opened this issue Jul 8, 2024 · 2 comments
Assignees

Comments

@SuzGupta
Copy link
Contributor

SuzGupta commented Jul 8, 2024

@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
Copy link
Contributor Author

SuzGupta commented Jul 8, 2024

I think maybe this is the Skills View?

@SuzGupta
Copy link
Contributor Author

SuzGupta commented Jul 8, 2024

Relevant LOs from Lesson 3:

  • Enable Writing Tools functionality for custom text views
  • Implement text view protocols to support Writing Tools interactions (ex: UITextInteraction)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants