From the course: iOS Development: Architecture

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

The main UI thread

The main UI thread

From the course: iOS Development: Architecture

Start my 1-month free trial

The main UI thread

- When using apps on our iPhone or iPad, we expect them to respond properly, without delays. If you wanna create responsive apps, we must respect one rule, only do as much work on the main thread as needed, move everything else to a background thread. The main thread is reserved for UI-related tasks, long-running operations such as synchronous network calls or file io, shouldn't run on the main thread. Otherwise, we're taking away time from executing UI-related tasks. Thus, our application becomes sluggish. Animations and scrolling won't be that smooth as they should be or the user interface simply stops responding to touches. We'll start with an example of such an unresponsive app, if you wanna follow along with me, you can find the project in the exercise files, chapter five, 5.1, begin. Now, let's open up the project. The app has a simple user interface, it consists of a single, UI collection view controller. Each collection view cell contains an image view. We're going to populate…

Contents