iOS 15 Sample Code "RestoringYourAppsState" - Bug

There appears to be a bug in the sample code provided as a download here:

https://developer.apple.com/documentation/uikit/uiscenedelegate/restoring_your_app_s_state

When MULTIPLE "Products" are opened in their ImageScenes, from the main scene using the long press + "Open in New Window", then dismissed using the close button "x", ImageScenes are swapped but it seems that they are either persisted or restored.

The bug appeared with iOS 15.

I am using the sample code to understand the problem - as I a similar problem appeared with iOS 15 with my own App

Would appreciate feedback on why the sample app misbehaves.

Thanks in advance.

Correction....

When MULTIPLE "Products" are opened in their ImageScenes, from the main scene using the long press + "Open in New Window", then dismissed using the close button "x", ImageScenes are not deleted - rather it seems that they either swapped, or deleted and immediately restored.

iOS 15 Sample Code "RestoringYourAppsState" - Bug
 
 
Q