Created
April 14, 2014 10:09
-
-
Save myell0w/10634621 to your computer and use it in GitHub Desktop.
UIView queued animations
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation UIView (AnimationQueue) | |
+ (void)mtd_animateWithDuration:(NSTimeInterval)duration animations:(void (^)(void))animations completion:(void (^)(BOOL finished))completion semaphore:(dispatch_semaphore_t)semaphore { | |
dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER); | |
[self animateWithDuration:duration animations:animations completion:^(BOOL finished) { | |
dispatch_semaphore_signal(semaphore); | |
if (completion) { | |
completion(finished); | |
} | |
}]; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment