Pages

Sunday, May 12, 2013

Delay Code in iOS

double delayInSeconds = 6.0; 
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC); dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ 
// unhide views, animate if desired
 [self.navigationController popViewControllerAnimated:YES]; 
});