rlzz
0
Q:

swift loop through array

let names = ["a", "b", "c"]

for name in names {
    print(name)
}
3
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
}
4

New to Communities?

Join the community