1 hour tutorials Beginner level

Creating an AR App with ARKit

This guide covers the basics of creating an augmented reality application using ARKit for iOS devices.

ARKit_example.swift SWIFT
import ARKit

class ViewController: UIViewController {
    @IBOutlet var sceneView: ARSCNView!

    override func viewDidLoad() {
        super.viewDidLoad()
        let configuration = ARWorldTrackingConfiguration()
        configuration.planeDetection = [.horizontal, .vertical]
        sceneView.session.run(configuration)
        addTapGesture()
    }

    func addTapGesture() {
        let tapGesture = UITapGestureRecognizer(target: self, action: #selector(handleTap(_:)))
        sceneView.addGestureRecognizer(tapGesture)
    }

    @objc func handleTap(_ sender: UITapGestureRecognizer) {
        let location = sender.location(in: sceneView)
        let hitTestResults = sceneView.hitTest(location, types: .existingPlaneUsingExtent)
        if let result = hitTestResults.first {
            let anchor = ARAnchor(transform: result.worldTransform)
            sceneView.session.add(anchor: anchor)
        }
    }
}

About This Guide

This guide covers the basics of creating an augmented reality application using ARKit for iOS devices.

Guide Information

Duration

1 hour

Difficulty

Beginner

Tags

AR, iOS development, ARKit

Connect With Us
Empowering the future.

Copyright © 2026 Atragate IT Ltd. All Rights Reserved.