Created
December 17, 2013 21:13
-
-
Save jackcallister/8012713 to your computer and use it in GitHub Desktop.
Tim, help me. Animating with Objective-C
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)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