<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: -",
    "macOS: 14.0.0 -",
    "tvOS: 17.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Cinematic",
  "identifier" : "/documentation/Cinematic/CNScript-1ispe/Frame/detection(for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Cinematic"
    ],
    "preciseIdentifier" : "s:9Cinematic8CNScriptC5FrameV9detection3forAA11CNDetectionVSgSo0F2IDa_tF"
  },
  "title" : "detection(for:)"
}
-->

# detection(for:)

The detection in the frame with the given detection ID, if any.

```
func detection(for detectionID: CNDetectionID) -> CNDetection?
```

## Parameters

`detectionID`

The detection ID for the detection.

## Return Value

A detection for the frame with the given detection ID.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)