<!--
{
  "availability" : [
    "iOS: 11.0.0 -",
    "iPadOS: 11.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.13.0 -",
    "tvOS: 11.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Vision",
  "identifier" : "/documentation/Vision/VNRequest",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Vision"
    ],
    "preciseIdentifier" : "c:objc(cs)VNRequest"
  },
  "title" : "VNRequest"
}
-->

# VNRequest

The abstract superclass for analysis requests.

```
class VNRequest
```

## Overview

Other Vision request handlers that perform image analysis inherit from this abstract base class. Instantiate one of its subclasses to perform image analysis.

> Important:
> A ``doc://Vision/documentation/Vision/VNRequest`` discards the alpha channel of input images, so don’t rely on it.

## Topics

### Initializing a Request

[`init()`](/documentation/Vision/VNRequest/init())

Creates a new Vision request with no completion handler.

[`init(completionHandler:)`](/documentation/Vision/VNRequest/init(completionHandler:))

Creates a new Vision request with an optional completion handler.

### Configuring a Request

[`VNRequestCompletionHandler`](/documentation/Vision/VNRequestCompletionHandler)

A type alias to encapsulate the syntax for the completion handler the system calls after the request finishes processing.

[`completionHandler`](/documentation/Vision/VNRequest/completionHandler)

The completion handler the system invokes after the request finishes processing.

[`preferBackgroundProcessing`](/documentation/Vision/VNRequest/preferBackgroundProcessing)

A hint to minimize the resource burden of the request.

[`results`](/documentation/Vision/VNRequest/results)

The collection of observation results generated by request processing.

[`revision`](/documentation/Vision/VNRequest/revision)

The specific algorithm or implementation revision that’s used to perform the request.

[`usesCPUOnly`](/documentation/Vision/VNRequest/usesCPUOnly)

A Boolean signifying that the Vision request should execute exclusively on the CPU.

### Configuring the Compute Device

[`setComputeDevice(_:for:)`](/documentation/Vision/VNRequest/setComputeDevice(_:for:))

Assigns a compute device for a compute stage.

[`computeDevice(for:)`](/documentation/Vision/VNRequest/computeDevice(for:))

Returns the compute device for a compute stage.

[`supportedComputeStageDevices`](/documentation/Vision/VNRequest/supportedComputeStageDevices)

The collection of compute devices per stage that a request supports.

[`setComputeDevice:forComputeStage:`](/documentation/Vision/VNRequest/setComputeDevice:forComputeStage:)

Assigns a compute device for a compute stage.

[`computeDeviceForComputeStage:`](/documentation/Vision/VNRequest/computeDeviceForComputeStage:)

Returns the compute device for a compute stage.

[`supportedComputeStageDevicesAndReturnError:`](/documentation/Vision/VNRequest/supportedComputeStageDevicesAndReturnError:)

The collection of compute devices per stage that a request supports.

### Canceling a Request

[`cancel()`](/documentation/Vision/VNRequest/cancel())

Cancels the request before it can finish executing.

### Executing a Completion Handler

[`VNRequestCompletionHandler`](/documentation/Vision/VNRequestCompletionHandler)

A type alias to encapsulate the syntax for the completion handler the system calls after the request finishes processing.

### Determining the Revision

[`VNRequestRevisionProviding`](/documentation/Vision/VNRequestRevisionProviding)

A protocol for specifying the revision number of Vision algorithms.

[`currentRevision`](/documentation/Vision/VNRequest/currentRevision)

The current revison supported by the request.

[`defaultRevision`](/documentation/Vision/VNRequest/defaultRevision)

The revision of the latest request for the particular SDK linked with the client application.

[`supportedRevisions`](/documentation/Vision/VNRequest/supportedRevisions)

The collection of currently-supported algorithm versions for the class of request.



---

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)