Last active
August 29, 2015 14:14
-
-
Save SuperY/0be8e01b7c9ab6dc94b6 to your computer and use it in GitHub Desktop.
TableView Cell Animation
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
@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 | |
]; | |
} |
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)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