Class

ARConfiguration

An object that defines the particular ARKit features you enable in your session at a given time.

Declaration

@interface ARConfiguration : NSObject

Overview

ARConfiguration defines a base class for the different options your AR experience can have. You don't allocate ARConfiguration yourself; instead, you instantiate one of its subclasses.

Choose Your Configuration

To implement the features of your AR experience, you create one of the following subclasses and run it on your session via runWithConfiguration:. A session can run only configuration at a time, so you pick the configuration that best facilitates the AR experience you desire.

ARWorldTrackingConfiguration

Tracks the device's position and orientation relative to any surfaces, people, or known images and objects that ARKit may find and track using the device's back camera.

ARBodyTrackingConfiguration

Tracks only human bodies using the device's back camera.

AROrientationTrackingConfiguration

Tracks only the device's orientation using the back camera.

ARImageTrackingConfiguration

Tracks only known images you provide via trackingImages, using the device's back camera.

ARFaceTrackingConfiguration

Tracks only faces in the device's selfie camera, including their movement and facial expressions.

ARObjectScanningConfiguration

Uses the back camera to collect high-fidelity data about specific objects you want your app to recognize later, at runtime.

Choose Frame Features

Some configurations support sub-features relating to a session's frame. You enable these features by setting the following flags in the configuration's frameSemantics:

ARFrameSemanticBodyDetection

Enables 2D human body tracking.

ARFrameSemanticPersonSegmentation

Enables people occlusion.

ARFrameSemanticPersonSegmentationWithDepth

Enables people occlusion, and provides you with depth information.

Switch Configurations at Runtime

When you want to toggle features like plane detection, frame semantics, and environment texturing, you switch your configuration at runtime by calling runWithConfiguration: on your existing session. Where possible, ARKit maintains all the information that was collected during the session under the prior configuration, such as information about the physical environment, and anchors.

Topics

Verifying Device Support

isSupported

A Boolean value indicating whether the current device supports this session configuration class.

Checking Frame Features

+ supportsFrameSemantics:

Checks whether a particular feature is supported.

Beta

Enabling Frame Features

frameSemantics

The set of active semantics on the frame.

Beta
ARFrameSemantics

Types of optional frame features you can enable in your app.

Beta

Configuring the AR Session

lightEstimationEnabled

A Boolean value specifying whether ARKit analyzes scene lighting in captured camera images.

worldAlignment

A value specifying how the session maps real-world device motion into a 3D scene coordinate system.

ARWorldAlignment

Options for how ARKit constructs a scene coordinate system based on real-world device motion.

Managing Video Capture Options

videoFormat

The video capture size and frame rate to be used for sessions running this configuration.

supportedVideoFormats

The set of video capture formats available on the current device.

ARVideoFormat

A video size and frame rate specification for use with an AR session.

Recording Audio

providesAudioData

A Boolean value that specifies whether to capture audio during the AR session.

Relationships

Inherits From

Conforms To

See Also

Essentials

Choosing Which Camera Feed to Augment

Augment the user's environment through either the front or back camera.

Verifying Device Support and User Permission

Check whether your app can use ARKit and respect user privacy at runtime.

Managing Session Lifecycle and Tracking Quality

Keep the user informed on the current session state and recover from interruptions.

ARSession

The main object you use to control an AR experience.

ARAnchor

A position and orientation of something of interest in the physical environment.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software