ARSCNView
A view that blends virtual 3D content from SceneKit into your augmented reality experience.
Declaration
class ARSCNViewOverview
The ARSCNView class provides an easy way to create augmented reality experiences that blend virtual 3D content with a device camera view of the real world. When you run the view’s provided ARSession object:
The view automatically renders the live video feed from the device camera as the scene background.
The world coordinate system of the view’s SceneKit scene directly responds to the AR world coordinate system established by the session configuration.
The view automatically moves its SceneKit camera to match the real-world movement of the device.
ARKit automatically matches SceneKit’s coordinate space to the real world, so after you place your app’s virtual content, it maintains the illusion of resting in the real-world as the user moves the device. See Providing 3D Virtual Content with SceneKit.
You don’t necessarily need to use the ARAnchor class to track positions of objects you add to the scene, but by implementing ARSCNViewDelegate methods, you can add SceneKit content to any anchors that are automatically detected by ARKit.
Because ARKit requires Metal, use only Metal features of SceneKit. For example:
This class supports only SCNProgram instances with Metal Shading Language code.
If you set the preferredRenderingAPI property to SCNRenderingAPI.openGLES2, the framework reverts the value to SCNRenderingAPI.metal.