Task for iPadOS handling of multiple windows. Might be useful for a user to be able to at least open up multiple article windows, though there are WWDC videos that are worth watching that provide suggestions to open a new window when:
- Dragging and Dropping
- Any Master-Detail setup
- Press & hold link, show pop up to "Open in new window"
It's an opt-in setup so our app currently limits the user to one window in iPadOS.
Engineering things to keep in mind:
- Would require some refactoring of AppDelegate callbacks into UIWindowSceneDelegates now (but while also still keeping the AppDelegate setup for iOS12).
- Would need to implement robust state restoration as windows are destroyed often in this setup.
- Would need to ensure snapshot is up to date in app switcher / window expose.
- Would need extra handling to make sure duplicate windows aren't created.
- There are different system window destruction animations we can use depending on the dismiss use case.
- Would also need extra handling for a notification (or nsuseractivity, any path into the app) to know which window to activate when tapped.
- Keep an eye out for shared state bugs. Singletons and delegates could bite us with this.
One last note - some UIApplication properties are now deprecated because of windowing.
- statusBarStyle
- statusBarHidden
- statusBarOrientation
- open(_:options:completionHandler:)
- keyWindow
New properties are on UIWindowScene now. We can move to these new properties even if we don’t plan to adopt multiple windows this year to set us up better for when we do adopt.