---
title: "imp_implementationWithBlock(_:)"
framework: Objective-C Runtime
role: symbol
role_heading: Function
platforms: [iOS 4.3+, iPadOS 4.3+, Mac Catalyst 13.1+, macOS 10.7+, tvOS 9.0+, visionOS 1.0+, watchOS 1.0+]
path: "objectivec/imp_implementationwithblock(_:)"
---

# imp_implementationWithBlock(_:)

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

## Declaration

```swift
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

Return Value The IMP that calls block. You must dispose of the returned IMP using the function.

## See Also

### Using Objective-C Language Features

- [objc_enumerationMutation(_:)](objectivec/objc_enumerationmutation(_:).md)
- [objc_setEnumerationMutationHandler(_:)](objectivec/objc_setenumerationmutationhandler(_:).md)
- [imp_getBlock(_:)](objectivec/imp_getblock(_:).md)
- [imp_removeBlock(_:)](objectivec/imp_removeblock(_:).md)
- [objc_loadWeak(_:)](objectivec/objc_loadweak(_:).md)
- [objc_storeWeak(_:_:)](objectivec/objc_storeweak(_:_:).md)
