---
title: beginSubjectAnalysisIfNecessary()
framework: visionkit
role: symbol
role_heading: Instance Method
path: visionkit/imageanalysisoverlayview/beginsubjectanalysisifnecessary()
---

# beginSubjectAnalysisIfNecessary()

Begins subject analysis on the overlay view’s image.

## Declaration

```swift
@MainActor final func beginSubjectAnalysisIfNecessary()
```

## Discussion

Discussion Subject analysis begins automatically without calling this method moments after the overlay view’s image displays onscreen. The framework ignores calls to this method if subject analysis is already in progress or complete. note: For subject analysis to begin, preferredInteractionTypes needs to contain a subject-related option, such as automatic, imageSubject, or visualLookUp.

## See Also

### Managing image subjects

- [highlightedSubjects](visionkit/imageanalysisoverlayview/highlightedsubjects.md)
