BRYSerialAnimationQueue 1.0.0

BRYSerialAnimationQueue 1.0.0

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Dec 2014

Maintained by Bryan Irace.


Downloads

Total69,089
Week0
Month0

Installs

Apps568
Pod Tries5
Test Targets36
powered by Segment

GitHub

Stars406
Watchers11
Forks23
Issues2
Contributors3
Pull Requests0

Code

Files2
LOCLines of Code 73


  • By
  • Bryan Irace

Perform UIView animations serially without blocking the main thread, using the same APIs you already know and love.

The main goal of the class is to make it easy to perform event-based animations (e.g. a user taps a button or a network callback completes). One perfect example is displaying banners inside of an application when push notifications are received. Simply add animation blocks to a BRYSerialAnimationQueueInstance and they'll be executed only once all of the previously queued animations have completed.

An added benefit is that nested animation code like this:

[UIView animateWithDuration:duration animations:^{
    label.alpha = 1;

} completion:^(BOOL finished) {
    [UIView animateWithDuration:duration delay:delay animations:^{
        label.alpha = 0;

    } completion:^(BOOL finished) {
        [label removeFromSuperview];
    }];
}];

Can be replaced with something a little cleaner, like:

[queue animateWithDuration:duration animations:^{
    label.alpha = 1;
}];

[queue animateWithDuration:duration delay:delay animations:^{
    label.alpha = 0;

} completion:^(BOOL finished) {
    [label removeFromSuperview];
}];