Do not let your user see spinners

Taykalo Paul
Aug 20, 2015 · 5 min read

Paul Taykalo, Lead iOS Engineer at Stanfy, a mobile design and development studio based in San Francisco.

Today, we are writing applications. And each application is connected to the Internet. Let’s just talk about those applications which are connected to the Internet. Often, when users perform some operation in the application, a server response is needed, so while this response is being performed, the user is staring at this:


There’s no problem with that if you really need to have a server response, and you need to have 100% correct data only. But the thing is that there are a lot of times when we can easily avoid showing the spinner to the user, and trick the user, showing him what he wants to see rather than showing spinners during every user interaction, even if those spinners are cute.

Types of user interaction

Let’s look at user interactions from the perspective of user expectations. When doing some operations in the application, the user can’t be sure about the result — before a publication is opened, it’s hard to predict its contents. On the other hand, some operations are highly predictable for the user:

Often all these operations require an internet connection in order to be executed, and in badly designed applications, we often see a spinner after each operation. In very badly designed applications, we see a spinner which locks the whole application screen (and which we don’t have the ability to cancel).


Somehow we need to convince the user that these operations are performing immediately. And here we’ll explain how we do that in our applications.

This approach doesn’t require big architecture solutions from the start and can be implemented at any moment of the application development cycle, without any harm to the original. Still, there are few things which are not required, but highly recommended. These things aren’t new and you can find a lot of information about how to use them correctly and why you need to have them in your application.


View Layer without logic

Taken from MVVM pattern. The main idea is that the View Layer doesn’t know anything about your business logic. All that this View Layer should care about are simple, plain objects, which have no business logic in them, or at least the View Layer shouldn’t know anything about it:

Updateable View Layer

The View layer should reflect any data changes that are performed in the data it renders. Let’s say a person’s name was changed. Your view should behave correctly, and be able to update itself when this happens. In our examples UIViewController will be the object which will respond to the changes in the model and will tell View to update itself with new data.

Request Manager

This is the object that is responsible for network operations in your application. You should have one (I hope you do). Also, it’s even better if your ViewController speaks with the Model layer, and the Model layer itself speaks with Request Manager. Again, this is not required, but this is how it works in our applications.

Application Structure

Here’s how(probably) your application works now. This is waaay too schematic, but you can update it with your own Structural Units.

So here’s what happens:

Let’s add one small thing

In order to trick the user we’ll need to have just one simple thing — the Optimistic Model.

Optimistic Model

The idea behind that is pretty straightforward. When the user changes something, the optimistic model gets the original object, tries to predict the potential result, then calls ViewController’s callback with this updated object, and then performs the actual operation in the background like the default Model. Once the real result is returned from the server, the optimistic model calls callback with the real object, or in case of an error, the Model performs callback with the original object and then calls error callback.

If we highlight possible flows, they can look like this:

Optimistic Model Implementation

Now, let’s look how the Optimistic Model implementation can look like

With this simple update we were able to perform network operations “immediately” (at least from the user perspective).

Let’s Summarize

What do we have as the result?



Now, press “recommend” button, and measure how long it takes to perform one simple action. Do you see the spinner there? :) So why would you put spinners in your application?

Stanfy is an agile software development company. We help others evaluate technology, develop and deploy software systems that tuned to work in mobile and wearable world. Drop us a line if you need a collaboration on your lean technology product or startup.

Stanfy Engineering Practices

Sharing latest thoughts on our development-focused blog

Stanfy Engineering Practices

Sharing latest thoughts on our development-focused blog

Taykalo Paul

Written by

I’m a Software Engineer at MacPaw. I like and I do programming

Stanfy Engineering Practices

Sharing latest thoughts on our development-focused blog