I have issues, i work with parse data base, and i have more then 200 data tables.
And more then 150 000 records. Now i have search bar which connect to table view.
My code to upload data from parse server in to table view:
searchBar.resignFirstResponder()
searchResult.removeAll(keepingCapacity: false)
answer.removeAll(keepingCapacity: false)
searchQuery.query.forEach { $0.whereKey("question", contains: searchBar.text) }
searchQuery.query.forEach { (query) in
query.findObjectsInBackground { (result, error) in
if let objects = result {
for object in objects {
let question = object.object(forKey: "question") as! String
let answer = object.object(forKey: "answer1") as! String
self.answer.append(answer)
self.searchResult.append(question)
}
DispatchQueue.main.async {
self.tableView.reloadData()
self.resignFirstResponder()
}
}
}
}
I have array of query which i stored at the separate module:
searchQuery.query
So my question is, when i come to the bottom table view, i want to load another function which will upload new data, how i can do this?