---
title: "runModal(for:completionHandler:)"
framework: Collaboration
role: symbol
role_heading: Instance Method
platforms: [macOS 10.5+]
path: "collaboration/cbidentitypicker/runmodal(for:completionhandler:)"
---

# runModal(for:completionHandler:)

Runs the identity picker modally as a sheet attached to a specified window.

## Declaration

```swift
func runModal(for window: NSWindow, completionHandler: (@Sendable (NSApplication.ModalResponse) -> Void)? = nil)
```

```swift
func runModal(for window: NSWindow) async -> NSApplication.ModalResponse
```

## Parameters

- `window`: The parent window for the sheet.
- `completionHandler`: The handler to run after the return value is known, but before the sheet is dismissed.

## See Also

### Running an Identity Picker

- [runModal(for:modalDelegate:didEnd:contextInfo:)](collaboration/cbidentitypicker/runmodal(for:modaldelegate:didend:contextinfo:).md)
- [runModal()](collaboration/cbidentitypicker/runmodal().md)
