willRestoreState
Asked on 05/28/2025
1 search
The concept of willRestoreState
is related to state restoration in applications. In the context of WWDC, state restoration is discussed in the session titled "Tailor macOS windows with SwiftUI." In this session, it is explained that state restoration saves the size and position of windows when the app quits and reopens them automatically the next time the app launches. However, for certain windows, like an "about" window, you might want to disable this automatic restoration. This can be done using the restoration behavior scene modifier in SwiftUI.
For more details, you can refer to the session Tailor macOS windows with SwiftUI (05:13).

Tailor macOS windows with SwiftUI
Make your windows feel tailor-made for macOS. Fine-tune your app’s windows for focused purposes, ease of use, and to express functionality. Use SwiftUI to style window toolbars and backgrounds. Arrange your windows with precision, and make smart decisions about restoration and minimization.

Enhance your UI animations and transitions
Explore how to adopt the zoom transition in navigation and presentations to increase the sense of continuity in your app, and learn how to animate UIKit views with SwiftUI animations to make it easier to build animations that feel continuous.

Extend your app’s controls across the system
Bring your app’s controls to Control Center, the Lock Screen, and beyond. Learn how you can use WidgetKit to extend your app’s controls to the system experience. We’ll cover how you can to build a control, tailor its appearance, and make it configurable.