Last active
February 18, 2017 03:57
-
-
Save brandhill/2f36f089aba3d33ba7688250cf77faed to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -(void)application:(UIApplication *)application performFetchWithCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler{ | |
| // Call or write any code necessary to get new data, process it and update the UI. | |
| // The logic for informing iOS about the fetch results in plain language: | |
| if (/** NEW DATA EXISTS AND WAS SUCCESSFULLY PROCESSED **/) { | |
| completionHandler(UIBackgroundFetchResultNewData); | |
| } | |
| if (/** NO NEW DATA EXISTS **/) { | |
| completionHandler(UIBackgroundFetchResultNoData); | |
| } | |
| if (/** ANY ERROR OCCURS **/) { | |
| completionHandler(UIBackgroundFetchResultFailed); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment