Contents

ARView

A view that enables you to display an AR experience with RealityKit.

Declaration

@MainActor @objc @preconcurrency class ARView

Mentioned in

Overview

Use an ARView instance to display rendered 3D graphics to the user. You typically add a single view to your app’s storyboard, and then provide an outlet for that view in your code. Alternatively, you can create and add a view to your view hierarchy programmatically at runtime, as you would any other view.

A view has a single Scene instance that you access through the read-only scene property. To the view’s Scene instance you add one or more AnchorEntity instances that tell the view’s AR session how to tether content to something in the real world. To each anchor, you attach a hierarchy of other Entity instances that make up the content of the scene.

[Image]

Additionally, you can use the view to:

  • Configure render options, environmental characteristics, and the camera mode.

  • Handle platform-appropriate user interaction in the form of mouse, keyboard, or gesture input.

  • Find entities at a given point in the view.

  • Access statistics and visualizations that help you debug your app.

Note that with ARView, a ModelEntity casts a grounding shadow on a physical surface by default. RealityView does not have this default behavior.

Topics

Creating a view

Working with the scene

Configuring the AR session

Providing environmental context

Managing the camera

Finding entities at a point in the view

Adding gesture recognizers to entities

Mapping between coordinate spaces

Handling touch input

Handling keyboard input

Handling mouse input

Managing the view

Taking a snapshot

Debugging the session

Structures

Instance Methods

Enumerations

Default Implementations

See Also

UIKit and AppKit presentation