<!--
{
  "availability" : [
    "DriverKit: -",
    "iOS: -",
    "iPadOS: -",
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "DriverKit",
  "identifier" : "/documentation/DriverKit/TYPE",
  "metadataVersion" : "0.1.0",
  "role" : "Macro",
  "symbol" : {
    "kind" : "Macro",
    "modules" : [
      "DriverKit"
    ],
    "preciseIdentifier" : "c:@macro@TYPE"
  },
  "title" : "TYPE"
}
-->

# TYPE

Annotates a method declaration to indicate that it conforms to an existing method signature.

```
#define TYPE(p)
```

## Parameters

`p`

The class and method name to which the method conforms. Specify this value using the format `<class>::<method>`. Specify the class and method names directly, and do not use a string.

## Discussion

Typically, you use this macro to implement DriverKit callbacks using your own custom methods. The macro lets you ignore the original method’s name and choose any name you want. Your method must still declare the same parameters and return type as the original method. For example, the following code shows how to declare a custom version of the [`DataAvailable`](/documentation/DriverKit/IODataQueueDispatchSource/DataAvailable) method of [`IODataQueueDispatchSource`](/documentation/DriverKit/IODataQueueDispatchSource) in your header file.

```swift
virtual void MyCustomDataAvailable (OSAction *action) TYPE(IODataQueueDispatchSource::DataAvailable);
```

This macro generates the following convenient symbols that you can use when configuring actions involving your custom method:

- A message ID constant you can pass to the <doc://com.apple.documentation/documentation/kernel/osaction/3438206-create> method of [`OSAction`](/documentation/DriverKit/OSAction). The constant takes the form `<ClassName>_<MethodName>_ID`. For example, if you add the [`TYPE`](/documentation/DriverKit/TYPE) macro to the `ReceiveData` method of your custom `MyDriver` class, the corresponding message ID constant is `MyDriver_ReceiveData_ID`.
- A `CreateAction_<Method>` function that creates an [`OSAction`](/documentation/DriverKit/OSAction) object targeting your custom method. For example, if the name of your custom method is `HandleTimer`, the name of the generated function is `CreateActionHandleTimer`.

---

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)