The target is explained by apple as:
"A dispatch queue's priority is inherited from its target queue. Use the dispatch_get_global_queue function to obtain a suitable target queue of the desired priority.
If you submit a block to a serial queue, and the serial queue’s target queue is a different serial queue, that block is not invoked concurrently with blocks submitted to the target queue or to any other queue with that same target queue."
https://developer.apple.com/reference/dispatch/1452989-dispatch_set_target_queue
1.
.main
will run on the main thread. The main thread is used primarily for UI work so you should be cautious when using this thread for work that is not UI related because it could make the UI hang or appear unresponsive. This queue has the highest priority.
2.
.global
is primarily used for other work that is not UI related. and schedules blocks when threads become available. the global queue has three priorities Low, Default & High
. This queue has the second highest priority with 3 different types.
3.
nil is the lowest priority and will be lower than any global queue. it has no priority, it just needs to get done.
Summary
.main as target for UI work
.global as target for other work that needs to be done as soon as possible
nil as target for work that just needs to get done at some point (your not bothered when)