Join Simon Allardice for an in-depth discussion in this video Refining background fetch code, part of iOS 7 SDK New Features.
Beginning where l left off there's one little thing I'm going to do here.…First I'm just going to get rid of that application…icon badge number, that was just to prove a point.…The issue is with this call to our fetchNewData method.…Now right now that is a very, very simple method that we have in…here but the likelihood is, is that might not be a straight forward call.…Our method for fetching data might…have its own multi-threading or callback methods.…So from our app delegate, we often want one to do something as simple as…this, just calling that method to fetch the…new data, and then calling the completion handler.…
because we won't actually be completed yet.…So the best practice here is that when doing background fetches.…Because we've been passed a completionHandler…into this method, into the app…delegate, but as we're calling other code we basically pass that completionHandler…around like a baton in a relay race so that…we always have it in whatever code we're go into.…So I'm going to make two tweaks to this code.…
- Working with automated configuration in Xcode
- Using asset catalogs
- Understanding color and space in the iOS 7 UI
- Adding and debugging Auto Layout constraints
- Adding background fetch support