<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreGraphics",
  "identifier" : "/documentation/CoreGraphics/CGDataConsumerCallbacks",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Core Graphics"
    ],
    "preciseIdentifier" : "c:@S@CGDataConsumerCallbacks"
  },
  "title" : "CGDataConsumerCallbacks"
}
-->

# CGDataConsumerCallbacks

A structure that contains pointers to callback functions that manage the copying of data for a data consumer.

```
struct CGDataConsumerCallbacks
```

## Overview

The functions specified by the `CGDataConsumerCallbacks` structure are responsible for copying data that Core Graphics sends to your consumer and for handling the consumer’s basic memory management. You supply this structure to the function [`init(info:cbks:)`](/documentation/CoreGraphics/CGDataConsumer/init(info:cbks:)) to create a data consumer.

## Topics

### Initializers

[`init()`](/documentation/CoreGraphics/CGDataConsumerCallbacks/init())

[`init(putBytes:releaseConsumer:)`](/documentation/CoreGraphics/CGDataConsumerCallbacks/init(putBytes:releaseConsumer:))

### Instance Properties

[`putBytes`](/documentation/CoreGraphics/CGDataConsumerCallbacks/putBytes)

A pointer to a function that copies data to the data consumer. For more information, see [`CGDataConsumerPutBytesCallback`](/documentation/CoreGraphics/CGDataConsumerPutBytesCallback).

[`releaseConsumer`](/documentation/CoreGraphics/CGDataConsumerCallbacks/releaseConsumer)

A pointer to a function that handles clean-up for the data consumer, or `NULL`.



---

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)