<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 18.0.0 -",
    "visionOS: 2.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Vision",
  "identifier" : "/documentation/Vision/TargetedImageRequestHandler",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Vision"
    ],
    "preciseIdentifier" : "s:6Vision27TargetedImageRequestHandlerC"
  },
  "title" : "TargetedImageRequestHandler"
}
-->

# TargetedImageRequestHandler

An object that performs image-analysis requests on two images.

```
final class TargetedImageRequestHandler
```

## Topics

### Creating a request handler

[`convenience init(sourceURL: URL, targetURL: URL, orientation: CGImagePropertyOrientation?)`](/documentation/Vision/TargetedImageRequestHandler/init(sourceURL:targetURL:orientation:))

Creates a handler for performing requests on an image at the specified URL.

[`convenience init(source: Data, target: Data, orientation: CGImagePropertyOrientation?)`](/documentation/Vision/TargetedImageRequestHandler/init(source:target:orientation:)-4wr1c)

Creates a handler for performing requests on an image contained in a data object.

[`convenience init(source: CGImage, target: CGImage, orientation: CGImagePropertyOrientation?)`](/documentation/Vision/TargetedImageRequestHandler/init(source:target:orientation:)-66ft9)

Creates a handler for performing requests on Core Graphics images.

[`convenience init(source: CVPixelBuffer, target: CVPixelBuffer, orientation: CGImagePropertyOrientation?)`](/documentation/Vision/TargetedImageRequestHandler/init(source:target:orientation:)-64lxw)

Creates a handler for performing requests on a Core Video pixel buffer.

[`convenience init(source: CMSampleBuffer, target: CMSampleBuffer, orientation: CGImagePropertyOrientation?)`](/documentation/Vision/TargetedImageRequestHandler/init(source:target:orientation:)-9u6ta)

Creates a request handler that performs requests on an image contained within a sample buffer.

[`convenience init(source: CIImage, target: CIImage, orientation: CGImagePropertyOrientation?)`](/documentation/Vision/TargetedImageRequestHandler/init(source:target:orientation:)-1nk14)

Creates a handler for performing requests on Core Image images.

### Performing the request

[`func perform<each T>(repeat each T) async throws -> (repeat (each T).Result)`](/documentation/Vision/TargetedImageRequestHandler/perform(_:)-1i4di)

Performs one or more framework requests on the handler’s image.

[`func perform<T>(T) async throws -> T.Result`](/documentation/Vision/TargetedImageRequestHandler/perform(_:)-2r0k8)

Performs a framework request on the handler’s image.

[`func performAll(some Collection<any TargetedRequest>) -> some AsyncSequence<VisionResult, Never>`](/documentation/Vision/TargetedImageRequestHandler/performAll(_:))

Schedules a collection of framework requests to perform on the handler’s image.

## Relationships

### Conforms To

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Sendable`](/documentation/Swift/Sendable)

---

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)