Class

ARCoachingOverlayView

A view that presents visual instructions that guide the user during session initialization and in limited tracking situations.

Declaration

class ARCoachingOverlayView : UIView

Overview

This view offers your users a standardized on-boarding routine. You can configure this view to automatically display during session initialization and in limited tracking situations, while giving the user specific instructions that best facilitate ARKit's world tracking.

Screenshot of the various states that coaching overlay can be in, along with their respective textual user instructions.

When you start your app, the coaching overlay asks the user to move the device in ways that help ARKit establish tracking. When you choose a specific goal like finding a plane, the view tailors its instructions accordingly. If your app needs to relocalize, the view guides the user to assist ARKit with relocalization. After the coaching overlay determines the goal has been met and no further coaching is required, it hides from the user's view.

For an example app that uses the coaching overlay, see Placing Objects and Handling 3D Interaction.

Support Automatic Coaching

By default, activatesAutomatically is enabled and therefore you should override coachingOverlayViewWillActivate(_:) to determine whether coaching is in progress. If interruptions cause ARKit to relocalize, coaching overlay will reappear and present helpful instructions to the user. Coordinate your actions to help the user focus on these instructions, for example, by hiding any UI that's not necessary during session initialization.

Topics

Delegating Events

var delegate: ARCoachingOverlayViewDelegate?

An object you supply that implements coaching event callbacks.

protocol ARCoachingOverlayViewDelegate

A set of callbacks you implement to be notified of coaching events.

Defining a Goal

var goal: ARCoachingOverlayView.Goal

A field that indicates your app's tracking requirements.

enum ARCoachingOverlayView.Goal

The options that specify your app's tracking requirements.

Activiting the View

var activatesAutomatically: Bool

A flag that indicates whether the coaching view activates automatically, depending on the current session state.

var isActive: Bool

A flag that indicates whether coaching is in progress.

func setActive(Bool, animated: Bool)

Controls whether coaching is in progress.

Providing the Session

var session: ARSession?

The session the view uses to provide coaching.

var sessionProvider: ARSessionProviding?

An object you designate that provides the current session.

See Also

World Tracking

Understanding World Tracking

Discover supporting concepts, features, and best practices for building great AR experiences.

class ARWorldTrackingConfiguration

A configuration that monitors the iOS device's position and orientation, while enabling you to augment the environment that's in front of the user.

class ARPlaneAnchor

A 2D surface that ARKit detects in the physical environment.

Tracking and Visualizing Planes

Detect surfaces in the physical environment and visualize their shape and location in 3D space.

Placing Objects and Handling 3D Interaction

Place virtual content on real-world surfaces, and enable the user to interact with virtual content by using gestures.

class ARWorldMap

The space-mapping state and set of anchors from a world-tracking AR session.

Saving and Loading World Data

Serialize a world tracking session to resume it later on.

Ray-Casting and Hit-Testing

Find 3D positions on real-world surfaces given a screen point.

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