Retrieve only 5 users at a time :Firebase [like Instagram]
For the past few days, I have been trying to create an Instagram-like feed for my app. To be more specific: load new posts (5) each time the user updates the feed from the bottom. I am currently using Firebase to both store and display my data. My code so far, looks like this: var ref:FIRDatabaseReference! var dict = [String:Any]() var posts = [[String:Any]]() override func viewDidLoad() { super.viewDidLoad() tableView.delegate = self tableView.dataSource = self ref = FIRDatabase.database().reference() // Do any additional setup after loading the view, typically from a nib. } override func