---
title: "runModal(for:keychain:)"
framework: securityinterface
role: symbol
role_heading: Instance Method
path: "securityinterface/sfkeychainsettingspanel/runmodal(for:keychain:)"
---

# runModal(for:keychain:)

Displays a panel that allows users to change keychain settings.

## Declaration

```swift
func runModal(for settings: UnsafeMutablePointer<SecKeychainSettings>!, keychain: SecKeychain!) -> Int
```

## Parameters

- `settings`: A pointer to a keychain settngs structure. Because this structure is versioned, you must preallocate it and fill in the version of the structure.
- `keychain`: The keychain whose settings you wish to have the user change.

## Discussion

Discussion The method result indicates which button the user clicks: NSOKButton or NSCancelButton . If the user attempts to chanage the settings of a locked keychain, the unlock authorization dialog appears.

## See Also

### Displaying a sheet or panel

- [beginSheet(for:modalDelegate:didEnd:contextInfo:settings:keychain:)](securityinterface/sfkeychainsettingspanel/beginsheet(for:modaldelegate:didend:contextinfo:settings:keychain:).md)
