Skip to content

Instantly share code, notes, and snippets.

@jackcallister
Created December 17, 2013 21:13
Show Gist options
  • Save jackcallister/8012713 to your computer and use it in GitHub Desktop.
Save jackcallister/8012713 to your computer and use it in GitHub Desktop.
Tim, help me. Animating with Objective-C
-(void)animateButton:(UIButton *)sender
{
CGRect originalFrame = sender.frame;
CGRect newFrame = CGRectMake(originalFrame.origin.x - 3, originalFrame.origin.y - 3, originalFrame.size.width + 6, originalFrame.size.height + 6);
[UIView animateWithDuration:0.4 delay:0 options:(UIViewAnimationOptionAutoreverse)
animations:^{
sender.frame = newFrame;
}
completion:^(BOOL finished){
sender.frame = originalFrame;
}];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment