A shared object that manages the device camera and motion processing needed for augmented reality experiences.
- iOS 11.0+
ARSession object coordinates the major processes that ARKit performs on your behalf to create an augmented reality experience. These processes include reading data from the device's motion sensing hardware, controlling the device's built-in camera, and performing image analysis on captured camera images. The session synthesizes all of these results to establish a correspondence between the real-world space the device inhabits and a virtual space where you model AR content.
Every AR experience built with ARKit requires a single
ARSession object. If you use an
ARSKView object to easily build the visual part of your AR experience, the view object includes an
ARSession instance. If you build your own renderer for AR content, you'll need to instantiate and maintain an
ARSession object yourself.
Running a session requires a session configuration: an instance of the
ARConfiguration class, or its subclass
ARWorld. These classes determine how ARKit tracks a device's position and motion relative to the real world, and thus affect the kinds of AR experiences you can create.