Here we are, back to talk about GCD, let start by discussing the Terms ‘Synchronous’ and ‘Asynchronous’.
Synchronous and Asynchronous:
The threat that will implement this task, will wait till the task is over to return the control. It will block the current thread from executing another task until it’s done. While Asynchronous will not wait, it will directly return control, the task will start but not waiting for it to be completed, and will not block the thread from proceeding another function.
To Use Synchronous, just type as follow:
To use asynchronous, type as follow:
The last topic we will discuss is how to delay a task execution.
Thanks for reading, i hope you enjoyed and learned something new, feel free to leave any comment or question.