If you’ve been doing the homework in this course, you’ve been building a maze app by printing emoji directly on the screen. This has worked to demonstrate various techniques with SwiftUI.
Unfortunately, this app is static. The maze is “hardcoded” into the app. You could create variables to store the map data, but a far better solution is to use arrays.
Arrays allow you to store lots of related data. You can think of them as a row in a spreadsheet. You can also have arrays inside of arrays allowing to create columns. By using arrays, you can dynamically update the screen as well as introduce entirely new mazes.
Unfortunately, regular loops in SwiftUI can cause issues. For this reason, SwiftUI provides it’s own special loop and in using it, you’ll write your own special SwiftUI functions.
By the end of the lesson, you will learn to:
Identify the differences between a regular array and a multidimensional array.
Describe how to use the ForEach loop in SwiftUI.
Detail the steps needed to create a SwiftUI function.
See forum comments
This content was released on Apr 25 2025. The official support period is 6-months
from this date.
Learn about the various concepts covered in this lesson.
Download course materials from Github
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress,
bookmark, personalise your learner profile and more!
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.