@knutknatter @steveshepard The "What's new with text and text interactions" session from WWDC seems to suggest that using UITextInteraction is still preferred.
On adopting the redesigned UI of the caret and text selection, the engineer says “If you have a highly customized UI for displaying text, it can be challenging to keep up with these changes in your own implementation, especially if you aren't able to adopt UITextInteraction”.
@knutknatter @steveshepard I've just made a quick test with UITextSelectionDisplayInteraction and with the new API I'm no longer seeing the bug where the text selection handles are placed incorrectly on visionOS: https://mastodon.social/@simonbs/110903512345493534
So Apple is suggesting that UITextInteraction is preferred but it's exhibiting bugs that UITextSelectionDisplayInteraction isn't. Now, I have yet to discover which bugs UITextSelectionDisplayInteraction exhibits 😄
@simonbs @knutknatter Are you providing a selection container? If not, this might help:
- (nullable UIView *)selectionContainerViewBelowTextForSelectionDisplayInteraction:(UITextSelectionDisplayInteraction *)interaction;
@simonbs @knutknatter The interaction also tests for the private vars "selectionContainerView" and "_selectionContainerViewAboveText". Worth a try?
Per the earlier discussion, note also the "becomesEditableWithGestures" and "playsNicelyWithGestures" private vars. It looks like there is a rats nest of compatibility code in UITextInteraction. I feel bad for James.