Contents

ImageAnalyzer

An object that finds items in images that people can interact with, such as subjects, text, and QR codes.

Declaration

final class ImageAnalyzer

Mentioned in

Overview

To use an ImageAnalyzer object, first create an ImageAnalyzer.Configuration object, and specify the types of items you want to find in an image. Then pass the image you want to analyze and the configuration object to an ImageAnalyzer object using the analyze(_:configuration:) or similar method. This method returns an ImageAnalysis object that contains all the data VisionKit needs to implement the Live Text interface.

Next, show the Live Text interface. For iOS apps, set the interaction object of the view that contains the image to an instance of ImageAnalysisInteraction and set its analysis property to the ImageAnalysis object. To enable interactions with the image, set the interaction object’s preferredInteractionTypes property. To customize the Live Text interface, set the ImageAnalysisInteraction object’s delegate property and implement the ImageAnalysisInteractionDelegate protocol methods.

For macOS apps, add an ImageAnalysisOverlayView object above the view that contains the image, and set its analysis property. To enable interactions with the image, set the overlay view’s preferredInteractionTypes property. Set the ImageAnalysisOverlayView object’s delegate property and implement the ImageAnalysisOverlayViewDelegate protocol methods.

By default, the Live Text interface starts immediately when you show the view.

Topics

Handling availability

Creating image analyzers

Configuring image analyzers

Finding items in images

Structures

See Also

Content recognition and interaction in images