dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
dispatch_async(queue, ^{
dispatch_group_t _group = dispatch_group_create();
dispatch_group_async(_group, queue, ^{
dispatch_group_enter(_group);
//执行第一个任务
dispatch_group_leave(_group);
});
//等待上面请求完成之后再执行里面的步骤
dispatch_group_notify(_group, queue, ^{
//执行第二个任务
});
});
网友评论