---
title: "SKSearchCancel(_:)"
framework: Core Services
role: symbol
role_heading: Function
platforms: [macOS 10.4+]
path: coreservices/1442083-sksearchcancel
---

# SKSearchCancel(_:)

Cancels an asynchronous search request.

## Declaration

```swift
func SKSearchCancel(_ inSearch: SKSearch!)
```

## Parameters

- `inSearch`: The search object whose associated asynchronous search you want to cancel.

## Discussion

Discussion Call this function when you want to cancel an asynchronous search that you initiated with SKSearchCreate(_:_:_:). This function stops the search process if it is still in progress at the time. It does not dispose of the search object (SKSearchRef). Search Kit is thread-safe. You can use separate indexing and searching threads. Your application is responsible for ensuring that no more than one process is open at a time for writing to an index.

## See Also

### Fast Asynchronous Searching

- [SKSearchCreate(_:_:_:)](coreservices/1443079-sksearchcreate.md)
- [SKSearchFindMatches(_:_:_:_:_:_:)](coreservices/1448608-sksearchfindmatches.md)
- [SKSearchGetTypeID()](coreservices/1448621-sksearchgettypeid.md)
