main
The dispatch queue associated with the main thread of the current process.
Declaration
class var main: DispatchQueue { get }Discussion
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 execute blocks submitted to the main queue:
Calling dispatchMain()
Starting your app with a call to UIApplicationMain(_:_:_:_:) (iOS) or NSApplicationMain(_:_:) (macOS)
Using a CFRunLoop on the main thread
As with the global concurrent queues, calls to suspend(), resume(), dispatch_set_context, and the like have no effect when used on the queue in this property.
If your app has a long running task, such as making network call, run it on a global system queue, or on another background dispatch queue. Alternatively, use asynchronous versions of the call, if available.
See Also
Creating a Dispatch Queue
global(qos:)init(label:qos:attributes:autoreleaseFrequency:target:)DispatchQoS.QoSClassDispatchQueue.AttributesDispatchQueue.AutoreleaseFrequencyOS_dispatch_queue_mainOS_dispatch_queue_globalDispatchSerialQueueDispatchConcurrentQueuedispatch_queue_main_tdispatch_queue_global_tdispatch_queue_serial_tdispatch_queue_concurrent_t