After upgrading to Xcode 14, I noticed that the location where a dragged item is dropped in the simulator is not the location where the drag preview is displayed. This issue did not exist in my previous version of xcode.
By using the function dropEntered in the corresponding drop delegate, I see that when I drag an item into a point, say (row, col), on a grid in my UI view, as displayed by the preview, the drop delegate interprets it as entering into the point (row + 1, col).
The following warning appears in the Xcode output:
[Assert] CLIENT APP ERROR - Neither the view or container of the UITargetedPreview is currently in a window. This is in violation of UIDragInteraction API contract and can cause a severe visual glich. THIS IS A CLIENT APP BUG and will soon be a hard assert. PLEASE FIX ME
My guess is that the mismatch I see between the drag preview and the drag delegate's notion of the drop location is a manifestation of the visual glitch referred to in this warning.
But unfortunately, I don't understand how this warning relates to my drag and drop interactions, and how to fix the violation.
My entire drag and drop occurs within a high-level view that includes both the drag source view and the drop target views as descendants. So I don't understand what is meant by:
"Neither the view or container of the UITargetedPreview is currently in a window."
in my case.
Also, in checking the documentation of UIDragInteraction I did not see information about its contract referred to in the warning.
How should I go about fixing this violation and hopefully in the process fixing the mismatch between what is shown in the drag preview, and what is understood by the drop delegate to be the drop target?
My IOS deployment target is 15.2.
Many thanks.
Azad