线程组请求多个接口

dispatch_group_t group = dispatch_group_create();

dispatch_group_enter(group);

dispatch_group_async(group, dispatch_get_global_queue(0,0), ^{

dispatch_group_leave(group);

});

dispatch_group_enter(group);

dispatch_group_async(group, dispatch_get_global_queue(0,0), ^{

dispatch_group_leave(group);

});

dispatch_group_notify(group, dispatch_get_global_queue(0,0), ^{

//汇总mode

dispatch_async(dispatch_get_main_queue(), ^{

});

});

你可能感兴趣的:(线程组请求多个接口)