---
title: "init(wrappedValue:_:)"
framework: swiftui
role: symbol
role_heading: Initializer
path: "swiftui/scenestorage/init(wrappedvalue:_:)"
---

# init(wrappedValue:_:)

Creates a property that can save and restore an integer, transforming it to a RawRepresentable data type.

## Declaration

```swift
init(wrappedValue: Value, _ key: String) where Value : RawRepresentable, Value.RawValue == Int
```

## Parameters

- `wrappedValue`: The default value if an integer value is not available for the given key.
- `key`: A key used to save and restore the value.

## Discussion

Discussion A common usage is with enumerations: enum MyEnum: Int {     case a     case b     case c } struct MyView: View {     @SceneStorage("MyEnumValue") private var value = MyEnum.a     var body: some View { ... } }

## See Also

### Storing a value

- [init(_:)](swiftui/scenestorage/init(_:).md)
