Protocol

ARAnchorCopying

Support for custom ARAnchor subclasses.

Declaration

protocol ARAnchorCopying

Overview

An ARAnchor (or a instance of any anchor subclass) represents a position and orientation in world space, and optionally associates extra information with that point (like a name, or plane or image detection data). Each time ARKit generates an ARFrame object (describing the current environment as of a specific frame of live camera video), ARKit updates the anchors associated with the session as of that moment. Because anchor objects are immutable, ARKit must copy them to make changes from one ARFrame to the next.

If you create your own ARAnchor subclass, you must implement the init(anchor:) initializer required by this protocol. To ensure that any custom information in your subclass is maintained between successive frames, your implementation should copy any custom properties it declares.

Topics

Copying Anchors

init(anchor: ARAnchor)

Initializes a new anchor by copying custom information from another anchor.

Required.

Relationships

Inherits From

Conforming Types

See Also

Hit Testing and Real-World Positions

class ARHitTestResult

Information about a real-world surface found by examining a point in the device camera view of an AR session.

class ARAnchor

A real-world position and orientation that can be used for placing objects in an AR scene.

protocol ARTrackable

A real-world object in a scene for which ARKit tracks changes to position and orientation.