Use SpriteKit to place two-dimensional images in 3D space in your AR experience.
SpriteKit is inherently for 2D visual content, but augmented reality involves real-world 3D spaces. Use the
ARSKView class to create AR experiences by providing 2D sprites (
SKNode objects) that correspond to real-world 3D positions (
ARAnchor objects). When the user moves the device, the view automatically rotates and scales the SpriteKit nodes corresponding to anchors so that they appear to track the real world seen by the camera.
For example, you can place 2D images that appear to float in 3D space:
view(_: method above returns an
SKLabel object, which displays a text label. Like most SpriteKit nodes, this class creates a 2D visual representation, so the
ARSKView class presents the node in a billboard style: The sprite scales and rotates (around its z-axis) so that it appears to follow the 3D position of its anchor, but always faces toward the camera.