---
title: ARReferenceObject
framework: arkit
role: symbol
role_heading: Class
path: arkit/arreferenceobject
---

# ARReferenceObject

The description of a 3D object that you want ARKit to detect in the physical environment.

## Declaration

```swift
class ARReferenceObject
```

## Overview

Overview Object detection in ARKit lets you trigger AR content when the session recognizes a known 3D object. For example, your app could detect sculptures in an art museum and provide a virtual curator, or detect tabletop gaming figures and create visual effects for the game. To provide a known 3D object for detection, you scan a real-world object using ARKit: Run an AR session using ARObjectScanningConfiguration to enable collection of high-fidelity spatial mapping data. In that session, point the device camera at the real-world object from various angles, allowing ARKit to build up an internal map of the object and its surroundings. For an example of guiding user interactions to produce good scan data, see Scanning and Detecting 3D Objects. Determine the portion of the session’s world coordinate space representing the object to be recognized, and call createReferenceObject(transform:center:extent:completionHandler:) to get that portion as an ARReferenceObject ready for use in object detection. To save the reference object for use later or elsewhere, use the export(to:previewImage:) method to create an .arobject file. To detect objects in an AR session, pass a collection of reference objects to your session configuration’s detectionObjects property. You need not scan and detect objects in the same app: For example, you might create one app for scanning museum collections that outputs .arobject files, then bundle those files into another app meant for museum visitors. To bundle reference objects into an app, use your Xcode project’s asset catalog: In your asset catalog, use the Add (+) button to create an AR Resource Group. Drag .arobject into the resource group to create AR Reference Object entries in the asset catalog. Optionally, use the Xcode inspector panel to provide a descriptive name for the object, which appears as the name property at runtime and can be useful for debugging.

## Topics

### Loading Reference Objects

- [init(archiveURL:)](arkit/arreferenceobject/init(archiveurl:).md)
- [referenceObjects(inGroupNamed:bundle:)](arkit/arreferenceobject/referenceobjects(ingroupnamed:bundle:).md)

### Examining a Reference Object

- [name](arkit/arreferenceobject/name.md)
- [resourceGroupName](arkit/arreferenceobject/resourcegroupname.md)
- [center](arkit/arreferenceobject/center.md)
- [extent](arkit/arreferenceobject/extent.md)
- [scale](arkit/arreferenceobject/scale.md)

### Saving Recorded Objects

- [export(to:previewImage:)](arkit/arreferenceobject/export(to:previewimage:).md)
- [archiveExtension](arkit/arreferenceobject/archiveextension.md)

### Creating Derivative Reference Objects

- [applyingTransform(_:)](arkit/arreferenceobject/applyingtransform(_:).md)
- [merging(_:)](arkit/arreferenceobject/merging(_:).md)

### Debugging a Reference Object

- [rawFeaturePoints](arkit/arreferenceobject/rawfeaturepoints.md)

### Initializers

- [init(coder:)](arkit/arreferenceobject/init(coder:).md)

### Instance Properties

- [usdzFile](arkit/arreferenceobject/usdzfile.md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSSecureCoding](foundation/nssecurecoding.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Physical Objects

- [Visualizing and interacting with a reconstructed scene](arkit/visualizing-and-interacting-with-a-reconstructed-scene.md)
- [Scanning and Detecting 3D Objects](arkit/scanning-and-detecting-3d-objects.md)
- [ARObjectAnchor](arkit/arobjectanchor.md)
