<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVSampleBufferGenerator/notifyOfDataReady(for:completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVSampleBufferGenerator(cm)notifyOfDataReadyForSampleBuffer:completionHandler:"
  },
  "title" : "notifyOfDataReady(for:completionHandler:)"
}
-->

# notifyOfDataReady(for:completionHandler:)

Notifies the sample buffer generator when data is ready for the sample buffer reference or an error has occurred.

```
class func notifyOfDataReady(for sbuf: CMSampleBuffer, completionHandler: @escaping @Sendable (Bool, (any Error)?) -> Void)
```

## Parameters

`sbuf`

The `CMSampleBufferRef`.

`completionHandler`

A completion block that is called when data is ready for the sample buffer or an error occurs. The `dataReady` argument is <doc://com.apple.documentation/documentation/Swift/true> if data is read for the sample buffer. If an error occurs, the `error` argument contains the `NSError` object.

## Discussion

---

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)