---
title: "beginSheet(for:modalDelegate:didEnd:contextInfo:identities:message:)"
framework: securityinterface
role: symbol
role_heading: Instance Method
path: "securityinterface/sfchooseidentitypanel/beginsheet(for:modaldelegate:didend:contextinfo:identities:message:)"
---

# beginSheet(for:modalDelegate:didEnd:contextInfo:identities:message:)

Displays a list of identities in a modal sheet from which the user can select an identity.

## Declaration

```swift
func beginSheet(for docWindow: NSWindow!, modalDelegate delegate: Any!, didEnd didEndSelector: Selector!, contextInfo: UnsafeMutableRawPointer!, identities: [Any]!, message: String!)
```

## Parameters

- `docWindow`: The parent window to which the sheet is attached.
- `delegate`: The delegate object in which the method specified in the didEndSelector parameter is implemented.
- `didEndSelector`: A method selector for a delegate method called when the sheet has been dismissed. Implementation of this delegate method is optional.
- `contextInfo`: A pointer to data that is passed to the delegate method. You can use this data pointer for any purpose you wish.
- `identities`: An array of identity objects (objects of type doc://com.apple.documentation/documentation/Security/SecIdentity). Use the doc://com.apple.documentation/documentation/Security/SecIdentitySearchCopyNext function (in Security/SecIdentitySearch.h) to find identity objects.
- `message`: A message string to display in the sheet.

## Discussion

Discussion Use the identity method to obtain the identity chosen by the user. The delegate method has the following signature: - (void)createPanelDidEnd:(NSWindow *)sheet         returnCode:(int)returnCode         contextInfo:(void *)contextInfo The parameters for the delegate method are: The sheet is dismissed on return from the beginSheetForWindow:... method.

## See Also

### Related Documentation

- [runModal(forIdentities:message:)](securityinterface/sfchooseidentitypanel/runmodal(foridentities:message:).md)
- [identity()](securityinterface/sfchooseidentitypanel/identity().md)

### Displaying a Sheet or Panel

- [runModal(forIdentities:message:)](securityinterface/sfchooseidentitypanel/runmodal(foridentities:message:).md)
