I'm not sure if I understand exactly what you mean but here is my solution:
Create a class
Photo
which has1.1.
photoURL
asNSString
1.2.
numberOfLikes
andnumberOfComments
asNSInteger
.1.3.
arrayLikes
andarrayComments
asNSArray
ofNSString
for simplicity. If you want user to access other user's profile, you may think of create an another classUser
.In runtime, use an
arrayPhotos
to contains all the downloaded Photos.- Whether you display your photos in a table or a collection view, just use
indexPath.row
to access eachPhoto
inarrayPhotos
and get the informations.