---
title: "beginSheet(for:modalDelegate:didEnd:contextInfo:trust:showGroup:)"
framework: securityinterface
role: symbol
role_heading: Instance Method
path: "securityinterface/sfcertificatepanel/beginsheet(for:modaldelegate:didend:contextinfo:trust:showgroup:)"
---

# beginSheet(for:modalDelegate:didEnd:contextInfo:trust:showGroup:)

Displays a certificate chain in a modal sheet.

## Declaration

```swift
func beginSheet(for docWindow: NSWindow!, modalDelegate delegate: Any!, didEnd didEndSelector: Selector!, contextInfo: UnsafeMutableRawPointer!, trust: SecTrust!, showGroup: Bool)
```

## 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 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.
- `trust`: A doc://com.apple.documentation/documentation/Security/SecTrust object for the certificates to be displayed.
- `showGroup`: Specifies whether additional certificates (other than the leaf certificate) are displayed.

## Discussion

Discussion The sheet displays the leaf certificate plus any other certificates in the certificate chain that the Security Server can find. The delegate method has the following signature: -(void)certificateSheetDidEnd:(NSWindow *)sheet        returnCode:(NSInteger)returnCode        contextInfo:(void *)contextInfo The parameters for the delegate method are: The delegate method may dismiss the keychain settings sheet itself; if it does not, the sheet is dismissed on return from the beginSheetForDirectory:... method.

## See Also

### Displaying a Sheet or Panel

- [beginSheet(for:modalDelegate:didEnd:contextInfo:certificates:showGroup:)](securityinterface/sfcertificatepanel/beginsheet(for:modaldelegate:didend:contextinfo:certificates:showgroup:).md)
- [certificateView()](securityinterface/sfcertificatepanel/certificateview().md)
- [runModal(for:showGroup:)](securityinterface/sfcertificatepanel/runmodal(for:showgroup:).md)
- [runModal(forCertificates:showGroup:)](securityinterface/sfcertificatepanel/runmodal(forcertificates:showgroup:).md)
