About This Guide
This guide covers the basics of creating an augmented reality application using ARKit for iOS devices.
This guide covers the basics of creating an augmented reality application using ARKit for iOS devices.
import ARKit
class ViewController: UIViewController {
@IBOutlet var sceneView: ARSCNView!
override func viewDidLoad() {
super.viewDidLoad()
let configuration = ARWorldTrackingConfiguration()
sceneView.session.run(configuration)
addCube() // Call method to add a cube
}
func addCube() {
let cube = SCNBox(width: 0.1, height: 0.1, length: 0.1, chamferRadius: 0)
let cubeNode = SCNNode(geometry: cube)
cubeNode.position = SCNVector3(0, 0, -0.5) // Position in front of the camera
sceneView.scene.rootNode.addChildNode(cubeNode)
}
}
1 hour
Beginner
AR, iOS development, ARKit
Copyright © 2026 Atragate IT Ltd. All Rights Reserved.