<!--
{
  "availability" : [
    "macOS: 10.6.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSSavePanel/begin(completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSSavePanel(im)beginWithCompletionHandler:"
  },
  "title" : "begin(completionHandler:)"
}
-->

# begin(completionHandler:)

Presents the panel as a modeless window.

```
func begin(completionHandler handler: @escaping (NSApplication.ModalResponse) -> Void)
```

## Parameters

`handler`

The block to call after the user closes the panel. This block has no return value and takes a single parameter:

- result: The action taken by the user. The value of this parameter is [`NSFileHandlingPanelOKButton`](/documentation/AppKit/NSFileHandlingPanelOKButton) if the user chose the OK button or [`NSFileHandlingPanelCancelButton`](/documentation/AppKit/NSFileHandlingPanelCancelButton) if the user chose the Cancel button.

## Discussion

Configure all of the relevant properties of the panel before you call this method.

---

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)