dispatch_after code sample

No comments on dispatch_after code sample

Written by

in

double delayInSeconds = 2.0;
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC);
dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
    <#code to be executed on the main queue after delay#>
});

Apple GCD Reference

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *