SHARE
TWEET

Untitled

a guest Jul 21st, 2019 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. - (void)applicationDidEnterBackground:(UIApplication *)application
  2. {
  3.     // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
  4.     // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
  5.    
  6.     NSLog(@"%s", __FUNCTION__);
  7.    
  8.     __block UIBackgroundTaskIdentifier task = [application beginBackgroundTaskWithExpirationHandler:^{
  9.        
  10.         NSLog(@"Expiration handler called %f",[application backgroundTimeRemaining]);
  11.         [application endBackgroundTask:task];
  12.         task = UIBackgroundTaskInvalid;
  13.      }];
  14.    
  15.     [NSThread sleepForTimeInterval:2.0];   
  16.     [application endBackgroundTask:task];
  17. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top