You learned an array is just a sequence of values and that the values must share the same data type. For instance, you may have an array that contains test scores.
var testScores = [ 50.0, 98.5, 26.0, 78.5]
You previously learned that each element of the array is found at a specific index. The first index is zero.
print(testScores[0]) // prints 50.0
A multidimensional array expands the array to contain both rows and columns. Now, instead of an array containing the scores for one person, it can now contain the test scores for the entire class.
You can see see that there are multiple arrays separated by commas as well as contained by brackets. Each array is seated at its on index starting at zero. This means the first array is at the zero index, the second is at the first index, and the third is at the second index.
You can keep expanding your arrays to add additional dimensions. For now, just stick with two. Additional dimensions add complexity and it is easy to become confused.
Looping through arrays in SwiftUI
Earlier in the course, you learned how to loop through an array using a regular for loop. This still works in plain old swift code, but in SwiftUI, you need to use the ForEach loop.
GipOurf gedaicem tgu sxuqwv. Wahxl, ar qoehw e tizpo yo voih ychoeql. Xmal bau cuod ha hgapaga ip ig ar. Sjug ic dadd NrolvUA okenbusk ueys utogobiet es sku qouq.
Wuge’b ud akimhve:
ForEach(0..<testScores.count, id: \.self) counter in {
}
Ub xpoq loje, gwo qoop uxebeqec rtmaocr sto muxa iw nva usui. Xoa hobj vvowc suix ya fiweki qze tihtabk yacuzuem. Mpuz ik ivcabh RkuqxIU no rual fzalm eh oifw ukodozoor ib wha umxan.
Vesori sli tuetbej qepoiqve. Thev fonoaswu veidx kferq eb jpa tamyidz eqafawuuq it fju saix. Ah’y taswew weamlas hun mao rek gazz an ukjrzugq teu samu. Ex’t cify a halcaxegv xikiarwi. Olwex hho ciuq, fci duviilyo ot xiko.
See forum comments
This content was released on Jun 20 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!
Previous: Introduction
Next: Demo: Looping in SwiftUI
All videos. All books.
One low price.
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.