---
title: objectID
framework: avfoundation
role: symbol
role_heading: Instance Property
path: avfoundation/avmetadataobject/objectid
---

# objectID

A unique identifier for each detected object type (face, body, hands, heads and salient objects) in a collection.

## Declaration

```swift
var objectID: Int { get }
```

## Discussion

Discussion Defaults to a value of -1 when invalid or not available. When used in conjunction with an AVCaptureMetadataOutput, each newly detected object that enters the scene is assigned a unique identifier. objectIDs are never re-used as objects leave the picture and new ones enter. Objects that leave the picture and then re-enter are assigned a new objectID.

## See Also

### Inspecting the metadata

- [bounds](avfoundation/avmetadataobject/bounds.md)
- [duration](avfoundation/avmetadataobject/duration.md)
- [time](avfoundation/avmetadataobject/time.md)
- [type](avfoundation/avmetadataobject/type.md)
- [AVMetadataObject.ObjectType](avfoundation/avmetadataobject/objecttype.md)
- [isFixedFocus](avfoundation/avmetadataobject/isfixedfocus.md)
- [cinematicVideoFocusMode](avfoundation/avmetadataobject/cinematicvideofocusmode.md)
- [groupID](avfoundation/avmetadataobject/groupid.md)
