<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View/refreshable(action:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewPAAE11refreshable6actionQryyYaYbc_tF"
  },
  "title" : "refreshable(action:)"
}
-->

# refreshable(action:)

Adds an asynchronous handler that can update the data the view
displays when a person initiates a request, such as by pulling to refresh.

```
nonisolated func refreshable(action: @escaping @Sendable () async -> Void) -> some View
```

## Parameters

`action`

An asynchronous handler that SwiftUI executes when
a person requests a refresh. Use this handler to initiate
an update of model data displayed in the modified view. Use
`await` in front of any asynchronous calls inside the handler.

## Return Value

A view with a new refresh action in its environment.

## Discussion

Apply this modifier to a view to set the [`refresh`](/documentation/SwiftUI/EnvironmentValues/refresh)
value in the view’s environment to a [`RefreshAction`](/documentation/SwiftUI/RefreshAction) instance that
uses the specified `action` as its handler. Views that detect the
presence of the instance can change their appearance to provide a
way for a person to execute the handler.

For example, when you apply this modifier on iOS and iPadOS to a
[`List`](/documentation/SwiftUI/List), the list enables a standard pull-to-refresh gesture that
refreshes the list contents. When a person drags the top of the
scrollable area downward, the view reveals a progress indicator
and executes the specified handler. The indicator remains visible
for the duration of the refresh, which runs asynchronously:

```
List(mailbox.conversations) { conversation in
    ConversationCell(conversation)
}
.refreshable {
    await mailbox.fetch()
}
```

You can add refresh capability to your own views as well. For
information on how to do that, see [`RefreshAction`](/documentation/SwiftUI/RefreshAction).

---

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)