<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "Tor",
  "identifier" : "/documentation/Tor/TorControlClient/delOnion(_:)-xgca",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Tor"
    ],
    "preciseIdentifier" : "s:3Tor0A13ControlClientC8delOnionyyAA0E7ServiceVYaKF"
  },
  "title" : "delOnion(_:)"
}
-->

# delOnion(_:)

Convenience overload: delete an onion service by value.

```
func delOnion(_ service: OnionService) async throws
```

## Parameters

`service`

The service to delete.

## Discussion

Thin wrapper around [`delOnion(_:)`](/documentation/Tor/TorControlClient/delOnion(_:)-7ei4o) that reaches
into [`serviceID`](/documentation/Tor/OnionService/serviceID) for the ID. Prefer this
overload when you still hold the [`OnionService`](/documentation/Tor/OnionService) handed back
by [`addOnion(key:ports:detach:)`](/documentation/Tor/TorControlClient/addOnion(key:ports:detach:)) — keeps the two sides of
the lifecycle symmetric.

> Throws: Same errors as ``doc://Tor/documentation/Tor/TorControlClient/delOnion(_:)-7ei4o``.