The restoration behavior for a scene.
Use the ``Scene/restorationBehavior(_:)`` scene modifier to apply a
value of this type to a ``Scene`` you define in your ``App`` declaration.
The value you specify determines how the system will restore windows from a
previous run of your application.
For example, you may have a scene that you do not wish to be restored on
launch:
@main
struct MyApp: App {
var body: some Scene {
WindowGroup {
ContentView()
}
Window(id: "network-test", "Network Connection Test") {
NetworkTestView()
}
.restorationBehavior(.disabled)
}
}
Members (1)
get · iOS 18.0+
automatic
TypeScript
static get automatic(): SceneRestorationBehavior
Swift declaration
static let automatic: SceneRestorationBehavior
The automatic behavior. The scene's windows will be restored as defined
by the underlying platform.
On macOS, this behavior is governed by a system setting which can be
toggled on and off by the user. On all other platforms, it is enabled by
default.