
Realitykit
Build iOS augmented reality and 3D experiences with RealityKit and ARKit.
Install
npx skills add dpearson2699/swift-ios-skills --skill realitykit -g -a claude-code -y- Repository
- dpearson2699/swift-ios-skills1.3k
- Category
- Testing
- Updated
- 3mo ago
- License
- See repository
- Context cost
- Mediumabout 3,000 tokens
- Runs scripts
- No, instructions only
What it does
Build iOS augmented reality and 3D experiences with RealityKit and ARKit. Use when adding RealityView content, loading entities or USDZ models, anchoring objects to planes or world positions, distinguishing entity hit tests from ARKit real-world raycasts, handling AR camera availability, world tracking, scene updates, or RealityKit entity gestures and interactions.
RealityKit
Build AR experiences on iOS using RealityKit for rendering and ARKit for world
tracking. Covers RealityView, entity management, raycasting, scene
understanding, and gesture-based interactions. Targets Swift 6.3 / iOS 26+.
Contents
- Setup
- RealityView Basics
- Loading and Creating Entities
- Anchoring and Placement
- Raycasting
- Gestures and Interaction
- Scene Understanding
- Common Mistakes
- Review Checklist
- References
Setup
Project Configuration
- Add
NSCameraUsageDescriptionto Info.plist - On iOS,
RealityViewCameraContentdisplays an AR camera view by default (iOS 18+, macOS 15+); use.virtualcamera mode for explicit non-AR fallback - No entitlement is required for basic AR. If AR is core to the app, add the
arkitrequired-device capability; otherwise gate AR UI withisSupported.
Device Requirements
Check the exact AR configuration's isSupported value before presenting AR UI.
import ARKit
guard ARWorldTrackingConfiguration.isSupported else {
showUnsupportedDeviceMessage()
return
}
Key Types
| Type | Platform | Role |
|---|---|---|
RealityView | iOS 18+, visionOS 1+ | SwiftUI view that hosts RealityKit content |
RealityViewCameraContent | iOS 18+, macOS 15+ | Content displayed through an AR camera view on iOS, non-AR on macOS |
Entity | All | Base class for all scene objects |
ModelEntity | All | Entity with a visible 3D model |
AnchorEntity | All | Tethers entities to a real-world anchor |


