Skip to content

Instantly share code, notes, and snippets.

@ydzheng
Last active August 29, 2015 14:06
Show Gist options
  • Save ydzheng/781b0dfcfef557969621 to your computer and use it in GitHub Desktop.
Save ydzheng/781b0dfcfef557969621 to your computer and use it in GitHub Desktop.
- (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