Answers for "swift loop through array of objects"

4

swift loop through array

guard let currentUser = currentUser, 
    let photos = currentUser.photos as? [ModelAttachment] else 
{
    // break or return
}
// now 'photos' is available outside the guard
for object in photos {
    let url = object.url
}
Posted by: Guest on March-04-2020
0

swift loop through array of objet

let userPhotos = currentUser?.photos

for var i = 0; i < userPhotos!.count ; ++i {
    let url = userPhotos![i].url
}
Posted by: Guest on June-12-2020

Code answers related to "swift loop through array of objects"

Code answers related to "Swift"

Browse Popular Code Answers by Language