Here’s a nice way of indicating that a UISwitch is waiting for a network request to finish. Due to the instant nature of UISwitches, I did not want to block the user from anything but still let them know that this might be not 100% instant.
Since the user could press multiple times, we disable the switch while waiting. This would reduce the amount of requests we send to the server as well as take care of the multiple-activity-spinners being added (we could have it as a ivar as well, though).
Then we add some animations to make it smooth and looking really nice.
For really fast network connections, were the response would be so fast that it would look jarring, we could even add a small delay to the animations to ensure that the user sees the nice animations. This will also act as a sort of confirmation that something was done.
Other scenarios, such as facebooks like button, there is no spinner like this. Those small things are not really crucial to the app and it wouldn’t make sense to spend effort implementing it, the user might even be annoyed by it. In our case though, the switches are important enough to warrant a little activity indicator.