πWWDC19 | Session : 246 | Category :
πhttps://developer.apple.com/videos/play/wwdc2019/246/
π Dive into the details of window management in your Multitasking app, including how to properly handle creating, refreshing, and closing windows. Hear about best practices for when to refresh the content in your window and learn how to ensure your app's visual state is up-to-date in the switcher.
Activate a seesion only in reponse to direct and local user interaction
- UIKit creates a brand-new scene session.
- And let's you specify a configuration for it, by calling
configurationForConnectingSceneSession
- You can inspect the user activity which is given back to you now through the UI scene connecting options, to pick a session
sceneWillConnectToSession:
you are able to find your user activity and the connecting options, configure a window and view controller hierarchy for it.
sceneWillConnectToSession:
If the session is still existing, we go straight to the scene delegate.
If the session had been disconnected in the meantime.
continueUserActivity:
If the scene is still connected
Refresh a session for user-relevant updates
- Updates to shared data
- New user-relevant data
- Session and scene hygiene
- State restoration user activity
- Scene Activation conditions
- Session UI and switcher snapshot
If the scene is still connected, either in the foreground or the background, it can listen to the notification itself and call the API, which is going to do the right thing internally.
If the scene has been disconnected, the view controller won't be there anymore. And so, the long-libed object can step in, figure that out and call to refresh API in its place. The scene is goint then to be background connected and the view controller will have a chance to update itself and snapshot will be captured.
Destroy a session only in response to direct user interaction
Use the animation to acknowledge the user's intent