Writing asynchronous code

In Chapter 15, Syncing Data with CloudKit, you had an encounter with asynchronous code and multithreading. That chapter didn't go into much detail regarding multithreading and asynchronous code because the subject of threading is rather complex, and it's much more suited to a thorough discussion, which we're exploring in this chapter.

If you're unclear on what has already been explained, feel free to go back to Chapter 15, Syncing Data with CloudKit, to review the information presented there. The biggest takeaway from that chapter is that data fetching is performed on a background thread to avoid blocking the main thread. Once a fetch request is done, a callback function is executed, which allows you to use the main thread to update the user interface.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.116.28.22