# Remove Trusted Device

You can remove the current device from being a trusted device.

> In the future, you can also revoke other trusted devices from any trusted device.

## Removing this Trusted Device

To remove the current device from being a trusted device, do the following:

Example:

```swift
class SomeUIVC: UIViewController {
  @IBOutlet weak var textLabel: UILabel!

  var cotter: Cotter?

  override func viewDidLoad() {
    super.viewDidLoad()

    self.cotter = Cotter(
      apiSecretKey: "588d6f67-0981-4718-899b-bcd512de1aca",
      apiKeyID: "w4FK6Zz0XIhtGY3o5biI",
      cotterURL: "https://www.cotter.app/api/v0",
      userID: "hello@example.com",
      configuration: [:]
    )
  }

  // On Button Click
  @IBAction func removeTrustedDevice(_ sender: Any) {
    func callback(token: String, err: Error?) {
      if err != nil {
        self.textLabel.text = err?.localizedDescription
        return
      }
      self.textLabel.text = token
    }

    CotterWrapper.cotter?.removeTrustedDevice(vc: self, cb: callback)
  }
}
```

For the above callback, a text label will be populated to let the user know whether the removal succeeded or failed. Otherwise, if desired, the user can also perform a segue to another view controller in the callback function as well.

For the above example, clicking on the button linked to `removeTrustedDevice` in the view controller will make a request to remove the current device as a trusted device. If the request is successful, no error will exist, and a text label will be populated to let the user know whether the removal succeeded or failed. Otherwise, if desired, the user can also perform a segue to another view controller (on success or failure) in the callback function as well.

> You cannot remove the last Trusted Device. You will need to have 1 remaining Trusted Device.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cotter.app/sdk-reference/ios/ios-sdk-passwordless-login/remove-trusted-device.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
