udacity / ios-nd-networking

Resources for Udacity's iOS Networking with Swift course.
MIT License
173 stars 89 forks source link

Lists won't show more than 20 movies #13

Open OwenLaRosa opened 5 years ago

OwenLaRosa commented 5 years ago

When we get search results, or get the watchlist/favorites, the response we get back, and the MovieResults struct we decode into has properties for page, per_page, and total pages. How many movie results do you get per page? According to this discussion, only 20: https://www.themoviedb.org/talk/587bea71c3a36846c300ff73

To handle watchlist/favorites lists with more than 20 movies, we need to download from multiple pages. We can specify the page using the page query parameter. And you can use the total_pages property in the response to know the number of pages to fetch. How to solve this is up to you: perhaps you download all the pages at once, or get a bit fancier and download the next page as the table scrolls to the bottom. In either case, users with more than 20 movies on their lists should be able to view all of them.