3lvis/DATASource

Pagination

dneykov opened this issue · 5 comments

Is it possible to implement lazy loading rows with DATASource because?

Thanks.

3lvis commented

Hi @dneykov,

Could you elaborate with lazy loading rows? Like image loading?

Hi @3lvis no I don't need image loading. I have a table with 3000 rows now and it takes 3-5 seconds to load whole tableView. I can have more rows to that tableView. When I test it with 10000-12000 rows its really slow.
I was thinking of some lazy loading rows. So show first 1000 and when you go bottom to load more rows and so on.

Maybe the right word is pagination.

3lvis commented

@dneykov Could you try using fetchBatchSize

let request = NSFetchRequest<NSFetchRequestResult>(entityName: Tests.EntityName)
request.sortDescriptors = [NSSortDescriptor(key: "name", ascending: true)]
request.fetchBatchSize = 100

@3lvis I don't know what to say.
Big big thank you. You saved my day. It's loading really fast now.