---
title: "callAsFunction(value:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/dismisswindowaction/callasfunction(value:)"
---

# callAsFunction(value:)

Dismisses the window defined by the window group that is presenting the specified value type.

## Declaration

```swift
@MainActor @preconcurrency func callAsFunction<D>(value: D) where D : Decodable, D : Encodable, D : Hashable
```

## Parameters

- `value`: The value which is currently presented.

## Discussion

Discussion If multiple windows match the provided value, then they all will be dismissed. For dismissing a specific window in a specific group, use dismissWindow(id:value:). Don’t call this method directly. SwiftUI calls it when you call the dismissWindow action with an identifier and a value: dismissWindow(value: message.id) For information about how Swift uses the callAsFunction() method to simplify call site syntax, see Methods with Special Names in The Swift Programming Language.

## See Also

### Calling the action

- [callAsFunction()](swiftui/dismisswindowaction/callasfunction().md)
- [callAsFunction(id:)](swiftui/dismisswindowaction/callasfunction(id:).md)
- [callAsFunction(id:value:)](swiftui/dismisswindowaction/callasfunction(id:value:).md)
