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

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

Displays a modal sheet that shows the results of a certificate trust evaluation and that allows the user to edit trust settings.

## Declaration

```swift
func beginSheet(for docWindow: NSWindow!, modalDelegate delegate: Any!, didEnd didEndSelector: Selector!, contextInfo: UnsafeMutableRawPointer!, trust: SecTrust!, 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.
- `trust`: A trust management object. Use the doc://com.apple.documentation/documentation/Security/SecTrustCreateWithCertificates(_:_:_:) function (in Security/SecTrust.h) to create the trust management object.
- `message`: A message string to display in the sheet.

## Discussion

Discussion 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 delegate method may dismiss the keychain settings sheet itself; if it does not, the sheet is dismissed on return from the beginSheetForWindow:... method.

## See Also

### Related Documentation

- [SecTrustCreateWithCertificates(_:_:_:)](security/sectrustcreatewithcertificates(_:_:_:).md)
- [runModal(for:message:)](securityinterface/sfcertificatetrustpanel/runmodal(for:message:).md)

### Displaying a Sheet or Panel

- [runModal(for:message:)](securityinterface/sfcertificatetrustpanel/runmodal(for:message:).md)
