@simonbs @lextar @steveshepard Curious if you experience the same: When setting the new inlinePredictionType to yes, the prediction is triggered via setAttributedMarkedText. But when setting the marked range, the insertion caret disappears and does not re-appear even when removing and re-adding the UITextInteraction.
@knutknatter @simonbs Seeing the same thing. The caret disappears after inserting the attributed marked text. For me, it reappears after a tap. It looks like _UICursorAccessoryHostView is hidden after this call. I'll file a Feedback tomorrow AM.
@steveshepard @knutknatter I wonder if we avoid these bugs if we adopt the new UITextSelectionDisplayInteraction iOS 17. I’m going to try that one of the next few days.
@simonbs @steveshepard Wondering the same. Really didn’t want to have to go this route. I might try the same.

@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 😄

@knutknatter @steveshepard For some reason UITextSelectionDisplayInteraction draws selection handles and the caret below the text though. That's a bit awkward. I'm also not sure how to combine this with a non-editable interaction that allows users to select text only.
@knutknatter @steveshepard Apparently UITextInteraction also places these views below the text on iOS 17 so maybe this is an issue in my side.

@simonbs @knutknatter Are you providing a selection container? If not, this might help:

- (nullable UIView *)selectionContainerViewBelowTextForSelectionDisplayInteraction:(UITextSelectionDisplayInteraction *)interaction;

@steveshepard @knutknatter I was playing around with that but never got the views to be on top of the text. It seemed like even if I returned a view, the caret and selection handles were added to the same view as the interaction. Anyway, I think I’ve already given up on UITextSelectionDisplayInteraction as it seems there are a few gestures we aren’t getting for free like we do with UITextInteraction.

@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.

@steveshepard @knutknatter Ouch. It’s a frustrating situation right now. I really can’t figure out what we’re supposed to do. UITextInteraction has some new and bad bugs in iOS 17. If these aren’t fixed before the release, it’s really bad.