Instance Method


Sets an application-provided credential to be used when evaluating authentication.


func setCredential(_ credential: Data?, type: LACredentialType) -> Bool



The credential to be used when evaluating the authentication context.

Setting this parameter to nil removes any existing credential of the specified type.


The type of the specified credential. For possible values, see LACredentialType.

Return Value

true if the credential was set, otherwise false.

See Also

Managing Credentials

func isCredentialSet(LACredentialType) -> Bool

Returns a Boolean value indicating whether the specified credential type is set.

enum LACredentialType

The types of credentials to be used for authentication.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software