Skip to content

Instantly share code, notes, and snippets.

@ydzheng
Last active Aug 29, 2015
Embed
What would you like to do?
- (void)animateLockWithGestureRecognizer:(UIPanGestureRecognizer *)gr completion:(void (^)(void))completionBlock {
[self removeGestureRecognizer:gr];
//calculate animationDuration based on gr position and velocity
[UIView animateWithDuration:animationDuration animations:^{
//some calculation logic to determine a view’s location
[self updateSliderColor:offset];
} completion:^(BOOL finished) {
if (completionBlock) {
completionBlock();
}
}];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment