Multi platform template and state restoration

In the What’s New In SwiftUI video, the presenters showed the new multi platform SwiftUI app template and how it uses Scenes and WindowGroups. Does this new template still use SceneDelegate? If not, how do apps made with the template handle scene-based state restoration?

Replies

No, by default there is no need for a SceneDelegate with the new SwiftUI Apps and Scenes support. For state restoration, checkout the new @SceneStorage property wrapper. It's similar to @State, but has a specific identifier for persisting as state restored with the containing scene! The Data Essentials in SwiftUI talk will have more details on that and other stuff too.

(For advanced cases, you may need to bridge in an existing application or scene delegate and can do so using @UIApplicationDelegateAdaptor)