美文网首页
GCD定时器---操作

GCD定时器---操作

作者: lizhi_boy | 来源:发表于2016-12-19 13:38 被阅读7次
    执行间隔秒数
    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){
     //执行事件
    });
    
    
    
        dispatch_async(dispatch_get_main_queue(), ^{
            //事件
        });
    

    相关文章

      网友评论

          本文标题:GCD定时器---操作

          本文链接:https://www.haomeiwen.com/subject/fhctvttx.html