我有一组对象,我必须使用 afor-loop
和进行迭代DispatchGroup
。离开组内时for-loop
,需要打电话continue
吗?
let group = DispatchGroup()
for object in objects {
group.enter()
if object.property == nil {
group.leave()
continue // does calling this have any effect even though the group is handling it?
}
// do something with object and call group.leave() when finished
}
group.notify(...