Instance Method

sync(execute:)

Submits a work item for execution on the current queue and returns after that block finishes executing.

Declaration

func sync(execute workItem: DispatchWorkItem)

Parameters

workItem

The dispatch work item containing the task to execute. For information on how to create this work item, see DispatchWorkItem.

See Also

Executing Tasks Synchronously

func sync(execute: () -> Void)

Submits a block object for execution and returns after that block finishes executing.

func sync<T>(execute: () -> T) -> T

Submits a work item for execution and returns the results from that item after it finishes executing.

func sync<T>(flags: DispatchWorkItemFlags, execute: () -> T) -> T

Submits a work item for execution using the specified attributes and returns the results from that item after it finishes executing.