<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "StoreKit",
  "identifier" : "/documentation/StoreKit/DisplayMessageAction/callAsFunction(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "StoreKit",
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:17_StoreKit_SwiftUI20DisplayMessageActionV14callAsFunctionyy0aB00F0VKF"
  },
  "title" : "callAsFunction(_:)"
}
-->

# callAsFunction(_:)

Tells StoreKit to display the App Store message, if appropriate.

```
@MainActor func callAsFunction(_ message: Message) throws
```

## Parameters

`message`

The App Store message to display.

## Discussion

Don’t call this method directly. SwiftUI calls it when you call the [`DisplayMessageAction`](/documentation/StoreKit/DisplayMessageAction) structure using `message` as an argument.

For information about how Swift uses the [`callAsFunction()`](/documentation/StoreKit/RequestReviewAction/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*.

---

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)