I noticed a disparity between the Swift API for dispatch groups and the Objective-C API.
The init()
for DispatchGroup()
returns a non optional value.
But the Objective-C dispatch_group_create()
mentions a possibility for a NULL
return:
Return Value
The newly created group, or NULL on failure.
- What might cause the Objective-C function to fail? What behind the scenes issues could cause the creation of the group to not be possible?
- Why is the Swift version not optional but the Objective-C version is? If creation could fail for any reason why would those same reasons not apply to Swift?