Check out example codes for "swift loop through array of objet". It will help you in understanding the concepts better.

Code Example 1

let userPhotos = currentUser?.photos

for var i = 0; i < userPhotos!.count ; ++i {
    let url = userPhotos![i].url
}

Learn ReactJs, React Native from akashmittal.com