Instance Method

leave()

Explicitly indicates that a block in the group finished executing.

Declaration

func leave()

Parameters

group

The dispatch group to update. This parameter cannot be NULL.

Discussion

Calling this function decrements the current count of outstanding tasks in the group. Using this function (with enter()) allows your application to properly manage the task reference count if it explicitly adds and removes tasks from the group by a means other than using the dispatch_group_async(_:_:_:) function.

A call to this function must balance a call to enter(). It is invalid to call it more times than enter(), which would result in a negative count.

See Also

Updating the Group Manually

func enter()

Explicitly indicates that a block has entered the group.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software