---
title: "runModal(forCertificates:showGroup:)"
framework: securityinterface
role: symbol
role_heading: Instance Method
path: "securityinterface/sfcertificatepanel/runmodal(forcertificates:showgroup:)"
---

# runModal(forCertificates:showGroup:)

Displays one or more specified certificates in a modal panel.

## Declaration

```swift
func runModal(forCertificates certificates: [Any]!, showGroup: Bool) -> Int
```

## Parameters

- `certificates`: The certificates to display. Pass an doc://com.apple.documentation/documentation/Foundation/NSArray containing one or more objects of type doc://com.apple.documentation/documentation/Security/SecCertificate in this parameter. The first certificate in the array must be the leaf certificate. The other certificates (if any) can be included in any order.
- `showGroup`: Specifies whether additional certificates (other than the leaf certificate) are displayed. To show only a single certificate, specify only one doc://com.apple.documentation/documentation/Security/SecCertificate in the array and set showGroup to doc://com.apple.documentation/documentation/Swift/false.

## Return Value

Return Value This method returns the integer constant NSOKButton when dismissed.

## Discussion

Discussion The behavior of this method is somewhat different in macOS 10.4 and later versus OS X v10.3. In OS X v10.3, the panel displays whatever certificates you pass in the certificates parameter (provided the showGroup parameter is set to true). Starting with OS X v10.4, the panel displays the leaf certificate (that is, the first certificate in the array you pass) plus any other certificates in the certificate chain that the Security Server can find. If you include all of the certificates in the chain in the certificates parameter, you can ensure that the same certificates are displayed whatever the version of the operating system, and may decrease the time required to find and display the certificates in macOS 10.4 and later.

## See Also

### Displaying a Sheet or Panel

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