SceneStorage

A property wrapper type that reads and writes to persisted, per-scene storage.

ComponentiOS 14.0+macOS 11.0+tvOS 14.0+watchOS 7.0+SceneStorage in SwiftUI

Declaration

React
import { SceneStorage } from 'swiftui-react-native';
Swift
@frozen @propertyWrapper struct SceneStorage<Value>

Initializers

7 SwiftUI initializers back <SceneStorage>. The props you pass pick one.

React
<SceneStorage
  wrappedValue: string
  swiftKey: string
>
  children: (value: string, setValue: (value: string) => Promise<void>) => ReactNode
</SceneStorage>
Swift
init(wrappedValue: Value, _ key: String) where Value == URL
  • children*(value: string, setValue: (value: string) => Promise<void>) => ReactNode

    Renders the value, again whenever it changes.

  • wrappedValue*string
  • swiftKey*string

    Swift key: String

Also takes the common view props: modifiers, style and testID.

See also

More in State and environment.