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).