Persistent AR Mapping in iOS 12 ARKit 2 Explained

Persistent augmented reality (AR) mapping is a feature introduced by Apple in iOS 12 through ARKit 2 that allows devices to save, preserve, and reload AR experiences tied to specific physical locations. This article explains how ARKit 2 captures spatial data through world maps, how the system relocalizes digital objects across sessions, and how this technology enables both long-term persistence and shared multi-user AR experiences.

Understanding Persistent AR

Before ARKit 2, augmented reality sessions were temporary. When a user closed an AR application, the spatial tracking data was lost, and any placed virtual objects disappeared.

Persistent AR mapping solves this limitation by allowing an application to record the physical environment, save the spatial tracking state to local storage or the cloud, and restore that exact state in a future session. As a result, virtual objects remain anchored in the exact physical location where they were originally placed, even days or weeks later.

How It Works: The ARWorldMap

At the core of persistent AR mapping is the ARWorldMap object. During an active AR session, ARKit tracks visual feature points from the camera feed combined with internal motion sensor data.

The ARWorldMap packages:

  • Spatial Feature Points: A point cloud representing recognized surfaces, edges, and visual landmarks in the physical space.
  • Anchors: The positions, orientations, and metadata of virtual objects placed within the environment.
  • Extents and Trajectory: The physical boundaries of the mapped area and the device's movement history.

Developers can serialize this ARWorldMap data into a standard data file, store it on the device or a server, and unpack it when the app launches again.

The Relocalization Process

When an app loads a saved ARWorldMap, it enters a state called relocalization.

  1. The device activates the camera and begins scanning the current surroundings.
  2. ARKit compares the live camera feed and feature points against the stored point cloud within the loaded ARWorldMap.
  3. Once a sufficient number of matching visual landmarks are recognized, ARKit aligns its internal coordinate system with the saved coordinate system.
  4. The virtual anchors and their associated digital assets render back into their original physical locations.

Relocalization requires the physical environment to look reasonably similar to when it was first mapped. Major changes in lighting, moving furniture, or drastic visual alterations can hinder the device's ability to match the saved map.

Shared Multi-User Experiences

In addition to persistence over time, the ARWorldMap architecture introduced in ARKit 2 enables shared multi-user experiences.

Because the world map can be serialized into data, it can be transmitted over a local peer-to-peer network (such as MultipeerConnectivity) to a secondary iOS device in the same room. The second device loads the map, relocalizes itself against the same physical environment, and enters the exact same AR coordinate space. This allows multiple users to view and interact with the same digital objects simultaneously from different angles.

Key Use Cases

  • Collaborative Gaming: Local multiplayer games where players interact with the same virtual board on a physical tabletop.
  • Interior Design and Retail: Placing virtual furniture in a room and returning days later to see how it fits without having to reconfigure the scene.
  • Persistent Signage and Navigation: Leaving virtual sticky notes, instructions, or waypoints fixed to real-world objects for other users or future reference.