SceneStorage
struct · iOS 14.0+ · SDK 27.1
@frozen @propertyWrapper struct SceneStorage<Value>A property wrapper type that reads and writes to persisted, per-scene storage. You use `SceneStorage` when you need automatic state restoration of the value. `SceneStorage` works very similar to `State`, except its initial value is restored by the system if it was previously saved, and the value is shared with other `SceneStorage` variables in the same scene. The system manages the saving and restoring of `SceneStorage` on your behalf. The underlying data that backs `SceneStorage` is not available to you, so you must access it via the `SceneStorage` property wrapper. The system makes no guarantees as to when and how often the data will be persisted. Each `Scene` has its own notion of `SceneStorage`, so data is not shared between scenes. Ensure that the data you use with `SceneStorage` is lightweight. Data of a large size, such as model data, should not be stored in `SceneStorage`, as poor performance may result. If the `Scene` is explicitly destroyed (e.g. the switcher snapshot is destroyed on iPadOS or the window is closed on macOS), the data is also destroyed. Do not use `SceneStorage` with sensitive data.
Members (0)
This type has no directly callable members in this snapshot. See the framework’s skipped declarations for unsupported APIs.
Skipped declarations
5 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.
SceneStorage.init(wrappedValue:_:)
The containing type needs Swift generic type arguments. (no canonical witness for RowValue)
SceneStorage.init(wrappedValue:_:)
This declaration needs Swift generic type arguments. (no canonical witness for Value)
SceneStorage.init(wrappedValue:_:)
This declaration needs Swift generic type arguments. (no canonical witness for Value)
SceneStorage.init(_:)
The containing type needs Swift generic type arguments. (no canonical witness for R)
SceneStorage.init(_:)
The containing type needs Swift generic type arguments. (no canonical witness for R)