Functions

The following functions are available globally.

  • Submits a work item to a main queue if needed.

    Declaration

    Swift

    public func asyncOnMainIfNeeded(execute work: @escaping @convention(block) () -> Void)

    Parameters

    work

    The work item to be invoked on the main queue.

  • Submits a work item to a main queue.

    Declaration

    Swift

    public func asyncOnMain(execute work: @escaping @convention(block) () -> Void)

    Parameters

    work

    The work item to be invoked on the main queue.

  • Submits a work item to a main queue with the time at which to schedule the block for execution.

    Declaration

    Swift

    public func asyncOnMainAfter(deadline: Double, execute work: @escaping @convention(block) () -> Void)

    Parameters

    deadline

    The time at which to schedule the block for execution. Specifying the current time is less efficient than calling the async(execute:) method directly. Do not specify the value in distantFuture; doing so is undefined.

    work

    The work item to be invoked on the main queue.

  • Undocumented

    Declaration

    Swift

    public func callerClassName(file: String = #file) -> String