---
title: "detection(nearest:)"
framework: cinematic
role: symbol
role_heading: Instance Method
path: "cinematic/cndetectiontrack-2bxtd/detection(nearest:)"
---

# detection(nearest:)

Returns the array of detections in the detection track nearest a given time.

## Declaration

```swift
func detection(nearest time: CMTime) -> CNDetection?
```

## Parameters

- `time`: The time.

## Return Value

Return Value A number representing a properly time-stamped detection. The return value is only appropriate for discrete detection tracks.
