Created
December 5, 2013 07:29
-
-
Save leviathan/7801501 to your computer and use it in GitHub Desktop.
UITableViewCell scaling animation
This file contains 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)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { | |
// setup initial state (e.g. before animation) | |
cell.layer.shadowColor = [[UIColor blackColor] CGColor]; | |
cell.layer.shadowOffset = CGSizeMake(10, 10); | |
cell.alpha = 0; | |
cell.layer.transform = CATransform3DMakeScale(0.5, 0.5, 0.5); | |
cell.layer.anchorPoint = CGPointMake(0, 0.5); | |
// define final state (e.g. after animation) & commit animation | |
[UIView beginAnimations:@"scaleTableViewCellAnimationID" context:NULL]; | |
[UIView setAnimationDuration:0.7]; | |
cell.layer.shadowOffset = CGSizeMake(0, 0); | |
cell.alpha = 1; | |
cell.layer.transform = CATransform3DIdentity; | |
[UIView commitAnimations]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Animate two time first time?