<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 11.0.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 7.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/AppStorage",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI10AppStorageV"
  },
  "title" : "AppStorage"
}
-->

# AppStorage

A property wrapper type that reflects a value from `UserDefaults` and
invalidates a view on a change in value in that user default.

```
@frozen @propertyWrapper struct AppStorage<Value>
```

## Topics

### Storing a value

[`init(wrappedValue:_:store:)`](/documentation/SwiftUI/AppStorage/init(wrappedValue:_:store:))

Creates a property that can save and restore tab sidebar customizations.

[`init(_:store:)`](/documentation/SwiftUI/AppStorage/init(_:store:))

Creates a property that can read and write an Optional boolean user
default.

### Getting the value

[`wrappedValue`](/documentation/SwiftUI/AppStorage/wrappedValue)

[`projectedValue`](/documentation/SwiftUI/AppStorage/projectedValue)



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)