<!--
{
  "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/RefreshAction/callAsFunction()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI13RefreshActionV14callAsFunctionyyYaF"
  },
  "title" : "callAsFunction()"
}
-->

# callAsFunction()

Initiates a refresh action.

```
func callAsFunction() async
```

## Discussion

Don’t call this method directly. SwiftUI calls it when you
call the [`RefreshAction`](/documentation/SwiftUI/RefreshAction) structure that you get from the
[`Environment`](/documentation/SwiftUI/Environment):

```
struct RefreshableView: View {
    @Environment(\.refresh) private var refresh

    var body: some View {
        Button("Refresh") {
            Task {
                await refresh?()  // Implicitly calls refresh.callAsFunction()
            }
        }
        .disabled(refresh == nil)
    }
}
```

For information about how Swift uses the `callAsFunction()` method to
simplify call site syntax, see
[Methods with Special Names](https://docs.swift.org/swift-book/ReferenceManual/Declarations.html#ID622)
in *The Swift Programming Language*.
For information about asynchronous operations in Swift, see
[Concurrency](https://docs.swift.org/swift-book/LanguageGuide/Concurrency.html).

---

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)