Returns the serial dispatch queue associated with the application’s main thread.
- iOS 8.0+
- macOS 10.10+
- Mac Catalyst 13.0+Beta
- tvOS 9.0+
- watchOS 2.0+
Returns the main queue. This queue is created automatically on behalf of the main thread before
main is called.
The system automatically creates the main queue and associates it with your application’s main thread. Your app uses one (and only one) of the following three approaches to invoke blocks submitted to the main queue:
As with the global concurrent queues, calls to
dispatch_set_context, and the like have no effect when used with queues returned by this function.
Queues and Tasks
An object that manages the execution of tasks serially or concurrently on your app's main thread or on a background thread.
Dispatch Work Item
The work you want to perform, encapsulated in a way that lets you attach a completion handle or execution dependencies.
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