Function

dispatchMain()

Executes blocks submitted to the main queue.

Declaration

func dispatchMain() -> Never

Return Value

This function never returns.

Discussion

This function "parks" the main thread and waits for blocks to be submitted to the main queue. Applications that call UIApplicationMain(_:_:_:_:) (iOS), NSApplicationMain(_:_:) (macOS), or CFRunLoopRun() on the main thread must not call dispatchMain().

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