You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue #8 involves building a UI for creating links within the playground.
This task is about handling what happens when a link is tapped within the editor.
Currently, LexicalView has a LexicalViewDelegate method, textView(_, shouldInteractWith:, in:, interatction:). This method is essentially proxying a UITextView delegate method. (Note that TextView is our UITextView subclass, and LexicalView is a wrapper view around this, so there's a couple of layers here.)
We don't want to use delegate methods as ways of extending Lexical, since Lexical is best extended by means of registering commands. However, this code was written long ago, before we used commands for everything!
Ideal behaviour
There's already a .linkTapped command, and we use it in LexicalReadOnlyView. We want to make these changes:
Make LexicalView dispatch the .linkTapped command, rather than calling a delegate method.
Add a default implementation for .linkTapped within Lexical core, that just hands the URL to UIApplication to open. (Users of Lexical can register their own handler at a higher priority if they want different behaviour.)
The text was updated successfully, but these errors were encountered:
Issue #8 involves building a UI for creating links within the playground.
This task is about handling what happens when a link is tapped within the editor.
Currently,
LexicalView
has aLexicalViewDelegate
method,textView(_, shouldInteractWith:, in:, interatction:)
. This method is essentially proxying a UITextView delegate method. (Note thatTextView
is our UITextView subclass, andLexicalView
is a wrapper view around this, so there's a couple of layers here.)We don't want to use delegate methods as ways of extending Lexical, since Lexical is best extended by means of registering commands. However, this code was written long ago, before we used commands for everything!
Ideal behaviour
There's already a
.linkTapped
command, and we use it inLexicalReadOnlyView
. We want to make these changes:LexicalView
dispatch the.linkTapped
command, rather than calling a delegate method..linkTapped
within Lexical core, that just hands the URL to UIApplication to open. (Users of Lexical can register their own handler at a higher priority if they want different behaviour.)The text was updated successfully, but these errors were encountered: