A container that your extension fills to provide credentials through the QuickType bar.


class ASCredentialIdentityStore : NSObject


Make credential identities available to users directly in the QuickType bar by adding them to the shared instance of the identity store. You can add identities during configuration in your extension’s override of the prepareInterfaceForExtensionConfiguration() method. You can also update the shared store from within your extension’s host app.

Be sure to update the shared store whenever your app’s database changes to avoid showing stale identities in the QuickType bar. Take advantage of the incremental change methods replaceCredentialIdentities(with:completion:) and removeCredentialIdentities(_:completion:) to avoid rewriting the entire store every time you need to make a change.

When the user disables your extension, the system clears and disables your shared store. So before making updates, check to see that the store is enabled to avoid unnecessary activity:

let store = ASCredentialIdentityStore.shared
store.getState { state in
    if state.isEnabled {
        // Add, remove, or update identities.


Getting the Shared Store

class var shared: ASCredentialIdentityStore

The shared credential identity store.

Checking the State of the Store

func getState((ASCredentialIdentityStoreState) -> Void)

Gets the state of the credential identity store.

class ASCredentialIdentityStoreState

A representation of the state of a credential identity store.

Adding and Removing Credential Identities

func removeAllCredentialIdentities(((Bool, Error?) -> Void)?)

Removes all existing credential identities from the store.

class ASPasswordCredentialIdentity

A description that uniquely identifies a particular credential.

Recognizing Errors

struct ASCredentialIdentityStoreError

A credential identity store error.


Inherits From

Conforms To

See Also

Configuring the Credential Provider Extension

func prepareInterfaceForExtensionConfiguration()

Prepares the interface to enable the user to configure the extension.