So Apple recommends that we avoid doing too much work on the main thread. This is great advice, the less time you spend wasting CPU cycles in the main thread, the more responsive your UI will be. In my opinion a well defined iOS application will avoid doing more than update the UI on the main thread.
One prime example I’ve run into was some code that did a synchronous network request. It waited for the network response before returning and someone thought it had to run on the main thread. This resulted in a lock-up during some animations I was working on.
There’s a number of topics1 that I plan to discuss about getting things off of the main thread, but today I’m going to discuss running things on the main thread.