---
title: runModal()
framework: appkit
role: symbol
role_heading: Instance Method
path: appkit/nssavepanel/runmodal()
---

# runModal()

Displays the panel and begins its event loop with the current working (or last-selected) directory as the default starting point.

## Declaration

```swift
func runModal() -> NSApplication.ModalResponse
```

## Return Value

Return Value NSFileHandlingPanelOKButton (if the user clicks the OK button) or NSFileHandlingPanelCancelButton (if the user clicks the Cancel button).

## Discussion

Discussion This method invokes NSApplication’s runModal(for:) method with self as the argument.

## See Also

### Related Documentation

- [runModal(for:)](appkit/nsapplication/runmodal(for:).md)

### Showing the Panel

- [beginSheetModal(for:completionHandler:)](appkit/nssavepanel/beginsheetmodal(for:completionhandler:).md)
- [begin(completionHandler:)](appkit/nssavepanel/begin(completionhandler:).md)
- [validateVisibleColumns()](appkit/nssavepanel/validatevisiblecolumns().md)
