O'Reilly logo

Mastering iOS 10 Programming by Donny Wals

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Updating movies in the background

The final step in enabling background fetch for our application is to add the application(_:performFetchWithCompletionHandler:) method. As explained before, this method will be called by iOS whenever we're awoken from the background and it allows us to perform an arbitrary amount of work. Once we're done performing our task, we must call the completion handler that iOS has passed in to this method.

Upon calling the completion handler, we will inform iOS about the results of our operation. It's important to correctly report this status because background fetch is intended to improve the user experience. If you falsely report to iOS that you have new data all the time so your app is woken up more often, you're actually ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required