Anonymous
sync is when the code is executed in the order that it's written in, async means that the code inside the async block is run on a separate thread, and the programmer can't rely on the code running in the sequence it was written in. usually, for async, there's a callback method that the thread will execute after the async functionality returns. sync is used generally for code that needs to run in order, and async is used for actions that can take some indeterminant amount of time to come back, such as IO, networking, or graphics related functionality. a special thread on ios is main, which is the only thread that can execute UI related code. It's important to make sure you only update the UI from the main thread, otherwise your app will crash. So, for example if your code uses a different thread to get data from your backend async (because it will take time for the request to return), you'll have to call the main thread to update with the data after your request comes back.