MacKuba

🍎 Kuba Suder's blog on Mac & iOS development

WWDC 19

Window Management in Your Multitasking App

Categories: UIKit 0 comments Watch the video

Session activation:

  • should only happen in reaction to user’s direct action
  • pass requestingScene in activation options so that the system knows which scene opened which

The flow when you request session activation:

When new session is created:

  • AppDelegate: configurationForConnecting:options:
  • SceneDelegate: willConnectToSession:

If we connect to an existing session whose scene was released:

  • SceneDelegate: willConnectToSession:

If we connect to an existing session whose scene is still connected:

  • SceneDelegate: continueUserActivity:

You definitely want to implement all 3 of these.

Session refresh:

  • call it to perform user-relevant updates
  • e.g. the user updates something in one window and that same thing is visible in another window, or new data was fetched
  • works only for sessions that are not in the foreground (because you can update that one directly)
  • can happen immediately, but the system always decides when the right moment is based on current device conditions

You can update:

  • state restoration user activity
  • activation conditions
  • the UI and its snapshot

Session deletion:

  • do it on user’s request, or when the piece of data that the window was presenting no longer exists
  • available animations:
  • default = neutral action, e.g. closing a web page
  • commit = user has completed the action
  • decline = user has cancelled the action or discarded the changes


Leave a comment

*

*
This will only be used to display your Gravatar image.

*

What's the name of the base class of all AppKit and UIKit classes?

*