RealmSwift - Is Pagination Not Necessary?


#1

Hi,

I am using Realm Cloud and Swift as my language. I had been researching about the Prefetching API introduced by Apple in iOS 10. I was thinking I may have to use the Prefetching API, but after doing some further research, it seems that when using Realm the advantage is that results are lazily loaded, meaning I don’t even need to think about pagination. Is this thought process correct or should I be implementing limits to my queries?

Things to note:

I am using query based sync and using one single realm.

To test, I did the following:

  1. Created a table view
  2. Created a sync subscription and observed for when complete
  3. Upon complete, hide loading indicactor and called tableView.reloadData
  4. the numberOfRowsInSection is equal to an object that contains 500 records

The table view loaded very quickly and there was no choppy behavior (even when scrolling as fast as possible down the table view. This makes me think I don’t need to introduce limits to my queries.

Any insight would be greatly appreciated!