---
title: "remove(_:for:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/urlcredentialstorage/remove(_:for:)"
---

# remove(_:for:)

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

## Declaration

```swift
func remove(_ credential: URLCredential, for space: URLProtectionSpace)
```

## Parameters

- `credential`: The credential to remove.
- `space`: The protection space from which to remove the credential.

## Discussion

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

## See Also

### Adding and removing credentials

- [remove(_:for:options:)](foundation/urlcredentialstorage/remove(_:for:options:).md)
- [remove(_:for:options:task:)](foundation/urlcredentialstorage/remove(_:for:options:task:).md)
- [Dictionary key for credential removal options](foundation/dictionary-key-for-credential-removal-options.md)
- [set(_:for:)](foundation/urlcredentialstorage/set(_:for:).md)
- [set(_:for:task:)](foundation/urlcredentialstorage/set(_:for:task:).md)
