Contents

callAsFunction(value:)

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

Declaration

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

Parameters

  • value:

    The value which is currently presented.

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