ios dispatch_after 延时操作

double delayInSeconds = 1.0; 

__block ViewController* bself = self; 

dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{

    //延时操作

[self doSomething];

});

你可能感兴趣的:(ios dispatch_after 延时操作)