When I go from my app to the App Switcher by double-clicking the home button, the app is shown in the App Switcher view, still running. However, if I then kill the app by sliding it upward, it is killed without sceneDidEnterBackground ever having been called. This means the saved state ends up being whatever it was when the app was launched.
In an older app, which uses applicationDidEnterBackground, this problem does not exist; the method is always called, regardless of how I exit it, including when the app is killed by sliding it upward in the App Switcher.
Isn't sceneDidEnterBackground supposed to be called at the same moments as applicationDidEnterBackground in older apps? As far as I can see, it isn't, and I don't see how to get my app to write its state reliably. Saving state in sceneWillResignActive is not a good alternative, because in the App Switcher, the app is still running after that method is called, so whichever changes happen to its state after sceneWillResignActive is called would still be lost.