Submits a single block to the dispatch queue and causes the block to be executed the specified number of times.
- iOS 4.0+
- macOS 10.6+
- tvOS 9.0+
- watchOS 2.0+
The number of times to execute the block.
The queue on which to submit the block. It is recommended that you specify
DISPATCHfor this parameter, as that causes the block to run on a queue whose quality-of-service class is most appropriate for the current execution context.
The application-defined function to be submitted. This parameter cannot be
NULL. This block has no return value and takes one parameter:
The current iteration index.
This function submits a block to a dispatch queue for multiple invocations and waits for all iterations of the task block to complete before returning. If the target queue is a concurrent queue returned by
dispatch, the block can be invoked concurrently, and it must therefore be reentrant-safe. Using this function with a concurrent queue can be useful as an efficient parallel
The current index of iteration is passed to each invocation of the block.