CodeSOD: The Bogus Animation

This post was originally published on this site

The Daily WTF

Animations have become such an omnipresent part of our UI designs anymore that we tend to only notice them when they’re bad.

Ben is working on an iOS application which appeared to have a “bad” animation. In this case, it’s bad because it’s slow. How slow? Well, they have a table view with ten items in it, and the items should quickly tween to their new state- position, text, colors all could change in this process. And it was taking four seconds.

Four seconds to update ten items is a lot. Now, their application does have a lot of animations, and the first suspicion was that there was some ugly interaction between animations that was causing it to take a long time. But upon digging in, Ben discovered it wasn’t the animations at all.

– (NSArray<NSString *> *)_combineTitles:(NSArray<NSString *> *)oldTitles with:(NSArray<NSString *> *)newTitles { NSMutableSet<NSString *> *mergedSet = [NSMutableSet setWithArray:oldTitles];

To read the full article click on the 'post' link at the top.