Waits synchronously for the previously submitted block objects to finish; returns if the blocks do not complete before the specified timeout period has elapsed.
- iOS 4.0+
- macOS 10.6+
- tvOS 9.0+
- watchOS 2.0+
The dispatch group to wait on. This parameter cannot be
Returns zero on success (all blocks associated with the group completed before the specified timeout) or non-zero on error (timeout occurred).
This function waits for the completion of the blocks associated with the given dispatch group and returns when either all blocks have completed or the specified timeout has elapsed. When a timeout occurs, the group is restored to its original state.
This function returns immediately if the dispatch group is empty (there are no blocks associated with the group).
After the successful return of this function, the dispatch group is empty, and can be reused for additional blocks. See
dispatch for more information.
If your app isn’t using ARC, you should call
dispatch on a dispatch group when it’s no longer needed.