<!--
{
  "availability" : [
    "iOS: 4.3.0 -",
    "iPadOS: 4.3.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.7.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ObjectiveC",
  "identifier" : "/documentation/ObjectiveC/imp_implementationWithBlock(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Objective-C Runtime"
    ],
    "preciseIdentifier" : "c:@F@imp_implementationWithBlock"
  },
  "title" : "imp_implementationWithBlock(_:)"
}
-->

# imp_implementationWithBlock(_:)

Creates a pointer to a function that calls the specified block when the method is called.

```
func imp_implementationWithBlock(_ block: Any) -> IMP
```

## Parameters

`block`

The block that implements this method. The signature of `block` should be `method_return_type ^(id self, method_args …)`. The selector of the method is not available to `block`. `block` is copied with `Block_copy()`.

## Return Value

The [`IMP`](/documentation/ObjectiveC/IMP) that calls `block`. You must dispose of the returned [`IMP`](/documentation/ObjectiveC/IMP) using the function.

## 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)