Unexpected window resizing on iPadOS 16.4 after applicationDidEnterBackground

Starting on iPadOS 16.4 I noticed a new and unexpected behavior on iPad.

Configuration:

  • Tested on both iPad simulator and iPad real device with iPadOS 16.4
  • The app's window root view controller is set to UISplitViewController
  • The UISplitViewController delegate is being used to detect when it collapses and expands.

Scenario:

  1. Run the app
  2. Exit the app - applicationDidEnterBackground is fired
  3. splitViewController:collapseSecondaryViewController:ontoPrimaryViewController: is fired. Printing the traitsCollection of the main app's window shows that horizontalSizeClass is now Compact. (It was Regular before app was closed)
  4. Immediately after that, splitViewController:separateSecondaryViewControllerFromPrimaryViewController: is fired. Printing the traitsCollection of the main app's window shows that horizontalSizeClass is Regular.

On both steps #3 and #4, the stack trace shows that a snapshot is being executed.

Before iPadOS16.4, exiting the app didn't trigger the collapse/expand delegate methods.

It worth indicating that the horizontalSizeClass is eventually restored to the original value (of Regular) after step #4, so in most cases, this behavior shouldn't cause any issues. However, this "dancing" behavior where the horizontalSizeClass changes from regular to compact and back to regular, has some side effects in my use case.

I am not sure if this behavior is intended and by design, or its a bug.

Does anyone familiar with this?

Your being snapshotted for the app switcher and this is entirely expected.

Unexpected window resizing on iPadOS 16.4 after applicationDidEnterBackground
 
 
Q