udacity / ios-nd-networking

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

Refresh contents on favorites/watchlist #8

Open OwenLaRosa opened 5 years ago

OwenLaRosa commented 5 years ago

Right now, the watchlist and favorites list are initially populated from viewDidLoad. Then, we rely on adding and removing movies from the lists to keep the data in sync.

This works well if our app was the only app accessing account data. However, if the user was logged into the movie manager on a different device, or makes changes to their watchlist and favorites list on the Movie Databse website, the lists stored in the app will not be up-to-date until the next time the user logs in.

Ideally, our app be notified (receive a push) from the Movie Database that a users' list has changed, and then decide what to do to handle that response. This works great to avoid making too many network requests, but unfortunately, this functionality is not currently offered by the TMDB API.

The best we can do is to update the data, and a number of approaches might work

Each solution (and any others) have their own benefits and drawbacks, but providing a way for users to get the most up-to-date movie lists would prevent this buggy behavior.

BrentMifsud commented 5 years ago

the pull down to refresh method is quite simple to implement.

Take a look at https://www.youtube.com/watch?v=RvDYlPRm5Ww