<!--
{
  "availability" : [
    "macOS: 10.3.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SecurityInterface",
  "identifier" : "/documentation/SecurityInterface/SFChooseIdentityPanel/runModal(forIdentities:message:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Security Interface"
    ],
    "preciseIdentifier" : "c:objc(cs)SFChooseIdentityPanel(im)runModalForIdentities:message:"
  },
  "title" : "runModal(forIdentities:message:)"
}
-->

# runModal(forIdentities:message:)

Displays a list of identities in a modal panel.

```
func runModal(forIdentities identities: [Any]!, message: String!) -> Int
```

## Parameters

`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 panel.

## Discussion

This method returns <doc://com.apple.documentation/documentation/AppKit/NSOKButton> if the default button is clicked, or <doc://com.apple.documentation/documentation/AppKit/NSCancelButton> if the alternate button is clicked.

Use the [`identity()`](/documentation/SecurityInterface/SFChooseIdentityPanel/identity()) method to obtain the identity chosen by the user.

## See Also

  <doc://com.apple.documentation/documentation/Security/SecIdentitySearchCopyNext>

[`func identity() -> Unmanaged<SecIdentity>!`](/documentation/SecurityInterface/SFChooseIdentityPanel/identity())

Returns the identity that the user chose in the panel or sheet.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)