Getting Main Queue iOS
The main queue is the dispatch queue in which all the UI updates take place and the code involving UI changes are placed.
You need to get to the main queue in order to update UI on completion of an asynchronous process like NSURLSession
There are two types of main queue calls synchronous and asynchronous. When you invoke something synchronously, it means that the thread that initiated that operation will wait for the task to finish before continuing. Asynchronous means that it will not wait.