---
title: "imp_getBlock(_:)"
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_getblock(_:)"
---

# imp_getBlock(_:)

Returns the block associated with an IMP that was created using imp_implementationWithBlock(_:).

## Declaration

```swift
func imp_getBlock(_ anImp: IMP) -> Any?
```

## Parameters

- `anImp`: The doc://com.apple.objectivec/documentation/ObjectiveC/IMP that calls this block.

## Return Value

Return Value The block called by anImp.

## See Also

### Using Objective-C Language Features

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