Article Paging
AlexRamey opened this issue · comments
Right now, the backend exposes a syncAllData
and getArticles
method.
syncAllData
just grabs the 25 most recent articles from the API and saves them to the device.
getArticles
reads them from the device.
We need some way for the user to scroll and get more articles. The backend should expose a syncLatestArticlesForCategoryWithOffset(num, category, offset, completion)
function that tries to download the next batch of num
articles at the given offset
. On completion, it can invoke a completion closure.
Then the articleController could call this method and load more articles when it's done. Each table view cell can manage loading more articles for its specific category.
A maximum of 50 articles per category should be allowed.
Related: Investigate NSFetchedResultsController