---
title: "defaultAppStorage(_:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/view/defaultappstorage(_:)"
---

# defaultAppStorage(_:)

The default store used by AppStorage contained within the view.

## Declaration

```swift
nonisolated func defaultAppStorage(_ store: UserDefaults) -> some View

```

## Parameters

- `store`: The user defaults to use as the default store for AppStorage.

## Discussion

Discussion If unspecified, the default store for a view hierarchy is UserDefaults.standard, but can be set a to a custom one. For example, sharing defaults between an app and an extension can override the default store to one created with UserDefaults.init(suiteName:_).

## See Also

### Saving state across app launches

- [Restoring your app’s state with SwiftUI](swiftui/restoring-your-app-s-state-with-swiftui.md)
- [AppStorage](swiftui/appstorage.md)
- [SceneStorage](swiftui/scenestorage.md)
