Instance Method

remove(_:for:options:)

Removes the specified credential from the credential storage for the specified protection space using the given options.

Declaration

func remove(_ credential: URLCredential, for space: URLProtectionSpace, options: [String : Any]? = nil)

Parameters

credential

The credential to remove.

space

The protection space from which to remove the credential.

options

A dictionary containing options to consider when removing the credential.

For possible keys, see Dictionary Key for Credential Removal Options. You should use this when trying to delete a credential that has the URLCredential.Persistence.synchronizable policy.

Discussion

The credential is removed from both persistent and temporary storage.

If you override this method, also override remove(_:for:options:task:).

See Also

Adding and Removing Credentials

func remove(URLCredential, for: URLProtectionSpace)

Removes the specified credential from the credential storage for the specified protection space.

func remove(URLCredential, for: URLProtectionSpace, options: [String : Any]?, task: URLSessionTask)

Removes the specified credential from the credential storage for the specified protection space, on behalf of the given task and using the given options.

func set(URLCredential, for: URLProtectionSpace)

Adds a credential to the credential storage for the specified protection space.

func set(URLCredential, for: URLProtectionSpace, task: URLSessionTask)

Adds a credential to the credential storage for the specified protection space, on behalf of the specified task.

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