<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "VisionKit",
  "identifier" : "/documentation/VisionKit/ImageAnalysisInteraction/subject(at:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "VisionKit"
    ],
    "preciseIdentifier" : "s:9VisionKit24ImageAnalysisInteractionC7subject2atAC7SubjectVSgSo7CGPointV_tYaF"
  },
  "title" : "subject(at:)"
}
-->

# subject(at:)

Returns the subject at the given point within the interaction’s image, if one exists.

```
@MainActor final func subject(at point: CGPoint) async -> ImageAnalysisInteraction.Subject?
```

## Parameters

`point`

A point in view coordinates at which to select a subject.

## Return Value

The subject that resides at `point`; or, `nil`, if no subject resides at `point`.

## Discussion

This method works for interaction types that include [`imageSubject`](/documentation/VisionKit/ImageAnalysisInteraction/InteractionTypes/imageSubject).

The following code retrieves a subject image given a screen point, for instance, where a person taps:

```swift
let configuration = ImageAnalyzer.Configuration()
...
interaction.preferredInteractionTypes = [.imageSubject]
...
let viewPoint = /* A point in view coordinates */
if let subjectObject = try await interaction.subject(at: viewPoint) {
    if let image = subjectObject.image {
        // Do something with the subject image.
    }
}
```

---

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)