---
title: cancel()
framework: foundation
role: symbol
role_heading: Instance Method
path: foundation/nsurlconnection/cancel()
---

# cancel()

Cancels an asynchronous load of a request.

## Declaration

```swift
func cancel()
```

## Discussion

Discussion After this method is called, the connection makes no further delegate method calls. If you want to reattempt the connection, you should create a new connection object.

## See Also

### Related Documentation

- [init(request:delegate:)](foundation/nsurlconnection/init(request:delegate:).md)
