---
title: cancel()
framework: network
role: symbol
role_heading: Instance Method
path: network/nwconnectiongroup/cancel()
---

# cancel()

Cancels the connection group object and leaves the network group.

## Declaration

```swift
final func cancel()
```

## See Also

### Managing Groups

- [stateUpdateHandler](network/nwconnectiongroup/stateupdatehandler.md)
- [NWConnectionGroup.State](network/nwconnectiongroup/state-swift.enum.md)
- [state](network/nwconnectiongroup/state-swift.property.md)
