Is there any UIKit engineer knowing how how to handle multiple scenes, or is it dark magic?
The Apple iOS apps, Pages for instance, handle multiple scene in a elegant way, whereas my app, using the same Activate/Destroy API, looks bad.
Replacing current scene with another scene: Open doc A in scene A, then open another scene B, and open the same A doc. Pages simply shows the former scene, and the latter one disappears. I succeeded to make my app work on iOS 15, but it works in an unyielding manner, as I described above: The current scene B is shrinked to half screen, then the target one, A, is activated on the other half of the screen, then B scene is destroyed, and finally scene A is enlarged on the whole screen.
Opening a document from Spotlight, that's already open in one of the existing scenes, does not activate that particular scene. Instead, it activates the last used scene, EVEN if there is another scene that has that doc already open. (I do set 'prefersToActivateForTargetContentIdentifierPredicate', but no luck). On Apple Pages, it activates the correct scene.