Skip to content

Instantly share code, notes, and snippets.

@etolstoy
Last active August 29, 2015 13:55
Show Gist options
  • Save etolstoy/8705268 to your computer and use it in GitHub Desktop.
Save etolstoy/8705268 to your computer and use it in GitHub Desktop.
Footer Menu Animation
- (void)showMenu
{
CALayer* layer = _menuButtonImageView.layer;
CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
animation.fromValue = [NSNumber numberWithFloat:0.0 * M_PI];
animation.toValue = [NSNumber numberWithFloat:1.0 * M_PI];
animation.duration = 0.3;
animation.cumulative = YES;
animation.repeatCount = 1;
animation.removedOnCompletion = NO;
animation.fillMode = kCAFillModeForwards;
[layer addAnimation:animation forKey:@"transform.rotation.z"];
[UIView animateWithDuration:0.3 animations:^{
[_menuView setFrame:CGRectMake(_menuView.frame.origin.x, self.view.frame.size.height - _menuView.frame.size.height, _menuView.frame.size.width, _menuView.frame.size.height)];
} completion:nil];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment