Hi,I am fetching data for my table view via a web service. Based on the request the result set can vary between 1 row and 20,000 rows. I know that usually my users are just interested in the first 1,000 rows of the data so I am wondering to have an approach where the initial web service call just loads the top 1,000 rows and when the user scrollls down the list and gets to the 800s, 900s or end of table, another request is triggered to fetch the next 1,000 rows - kinda similar to a Twitter feed where the data gets loaded once you scrolld down.What would the events be to trigger the call for the next set of data or is there another way to make this happen?Max
Post
Replies
Boosts
Views
Activity
for Hi,I am retrieving data from a web service in an URLSession and store all the entries to an arrayself.warehouseOrders.append(warehouseOrder)The array is used in another view as data source for a List() item but now I get this error message:Publishing changes from background threads is not allowed; make sure to publish values from the main thread (via operators like receive(on:)) on model updates.My question is: where is SwiftUI expecting me to put the operator receive(on:)) to fix this?I have kinda solved it by changing the code toDispatchQueue.main.async {
self.warehouseOrders.append(warehouseOrder)
}but I am not sure if that is the correct approach here?See https://forums.developer.apple.com/thread/128068for more details on my code - I have actually posted this already there as a reply but for some reason it still gets moderated for almost 24 hours ...Max