Skip to content

Instantly share code, notes, and snippets.

@SuperY
Last active August 29, 2015 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SuperY/0be8e01b7c9ab6dc94b6 to your computer and use it in GitHub Desktop.
Save SuperY/0be8e01b7c9ab6dc94b6 to your computer and use it in GitHub Desktop.
TableView Cell Animation
@implementation ATableCell
- (void)awakeFromNib{}
- (void)startAnimationWithDelay:(CGFloat)delayTime{
_tipView.transform = CGAffineTransformMakeTranslation(SCREENWIDTH, 0);
[UIView animateWithDuration:1. delay:delayTime usingSpringWithDamping:0.6 initialSpringVelocity:0
option:0
animations:^{
self.tipView.transform = CGAffineTransformIdentity;
}
completion:NULL
];
}
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell
forRowAtIndexPath:(NSIndexPath *)indexPath{
static CGFloat initialDelay = 0.2f;
static CGFloat stuffer = 0.2f;
if(isShowAnimation){
ATableCell *tipCell = (ATableCell *)cell;
[tipCell startAinimationWithDelay:initialDelay + ((indexPath.row)*stutter)];
if(indexPath.row == 10){
isShowAnimation = NO;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment