---
title: cancel()
framework: corespotlight
role: symbol
role_heading: Instance Method
path: corespotlight/csuserquery/cancel()
---

# cancel()

Cancels the current query operation.

## Declaration

```swift
func cancel()
```

## Discussion

Discussion Cancel a query operation when you no longer need the results. You can use this method to cancel queries started using either the start() method or by accessing the responses property.  After you cancel a query operation, you can’t restart it. To perform a new query, create a new query object. For example, you might cancel one query and start a new one when the text in your app’s search control changes.

## See Also

### Executing the query with handler blocks

- [start()](corespotlight/csuserquery/start().md)
- [foundSuggestionsHandler](corespotlight/csuserquery/foundsuggestionshandler.md)
- [foundSuggestionCount](corespotlight/csuserquery/foundsuggestioncount.md)
