'Approach arrange Firebase Database to present UIImage's in UITableView
I am trying to show on a UITableView which represents a feedpage simmilar to Instagram, all pictures of the currentUser friends but limited to 24 hours. A small aproach of the databse:
UUID : {
username : "Test1",
friends : {
autoGeneratedID : UUID
}
picturesUploaded: {
timestamp of the day as key : {
hour/minutes/seconds as key : {
time : timestamp,
utf64-string-data: data
}
}
}
The timestamp represent the day the pictures were added so as this I can monitor only pictures of last 24H. But my question is on every refresh of the page, is it the best aproach to set a counter of the last time was refreshed the page and when refresed again to search for pictures with a key value query starting from the last time was fetched till now, to get the last pictures added by each profile. Is there any other aproach for this kind of social media feedpages? As well, does anybody have any idea, in what way should i query it. I thought of first searching for the currentUser friends, then to iterate on each friend, and then fetch each user_friend pictures. But with this problem lets assume I have 400 friends, and all posted on the same day it will take long for a single fetch to get the pictures(here i thought to set a limit), how could i set it?
Thank you,
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
