AR + Swift Playground
This course combines Swift programming with augmented reality development on Apple devices. Students begin in Swift Playgrounds, where they solve puzzle worlds by grouping repeated commands into named functions, repeating patterns with for loops, and handling different situations with if / else if / else conditions. They then move from puzzles to real app development, building a first SwiftUI app in Swift Playgrounds with text views, stacks, buttons and state variables so that the interface responds to user taps. The final part introduces augmented reality: students compare AR with VR, build a 3D scene in Reality Composer on iPad using the asset library, anchors and tap behaviours, export the scene, and load it into the supplied RealityKit sample code so the scene appears through the device camera. Throughout the course students are asked to identify the repeating pattern in a problem before writing code, which builds the decomposition and logical thinking skills needed for larger app projects.
Learning objectives
- Write Swift functions, for loops and conditional statements to solve Swift Playgrounds puzzles by identifying the repeating pattern before coding.
- Build a first SwiftUI app using stacks, buttons and state variables so the interface responds to user interaction.
- Create an AR scene in Reality Composer with anchors and tap behaviours, then export it and load it into a RealityKit app running on an iPad.
Lesson plan
Prerequisites
- Swift Playgrounds commands lesson (L1) or equivalent block coding experience
Hardware
- iPad
- Mac
Software
- Swift Playgrounds
- Reality Composer (iPad)
- Xcode