Last active
August 29, 2015 14:01
-
-
Save jyliang/7f8887f78a68cbfad119 to your computer and use it in GitHub Desktop.
animation on/off block
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
- (void)modifyView:(UIView *)view animated:(BOOL)animated { | |
void (^block)() = ^{ | |
//modify view animation progress | |
}; | |
void (^completion)(BOOL) = ^(BOOL finished){ | |
//modify view completion | |
}; | |
if (animated) { | |
[UIView animateWithDuration:0.25f animations:block completion:completion]; | |
} else { | |
block(); | |
completion(YES); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment