Class

VNRequest

The abstract superclass for image analysis requests.

Overview

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

Topics

Initializing a Request

init()

Creates a new Vision request with no completion handler.

init(completionHandler: VNRequestCompletionHandler? = nil)

Creates a new Vision request with an optional completion handler.

Configuring a Request

var completionHandler: VNRequestCompletionHandler?

The completion handler block that's invoked after the request has finished processing.

var preferBackgroundProcessing: Bool

A hint to minimize the resource burden of the request.

var results: [Any]?

The collection of VNObservation results generated by request processing.

var usesCPUOnly: Bool

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

Executing a Completion Handler

typealias VNRequestCompletionHandler

A type alias to encapsulate the syntax for the completion handler block that's invoked after the request has finished processing.

Relationships

Inherits From

See Also

Still Image Analysis

class VNImageRequestHandler

An object that processes one or more image analysis requests pertaining to a single image.

class VNImageBasedRequest

The abstract superclass for image analysis requests that focus on a specific part of an image.

class VNObservation

The abstract superclass for image analysis results.