Created
June 29, 2016 05:44
-
-
Save ramakser/071db32280b846a172ae2180434270e5 to your computer and use it in GitHub Desktop.
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{ | |
/************* For bottom to top animation *****************/ | |
if ([animationType isEqualToString:@"BottomToTop"]) { | |
UIView *cellContentView = [cell contentView]; | |
CGFloat rotationAngleDegrees = -30; | |
CGFloat rotationAngleRadians = rotationAngleDegrees * (M_PI/180); | |
CGPoint offsetPositioning = CGPointMake(0, cell.contentView.frame.size.height*4); | |
CATransform3D transform = CATransform3DIdentity; | |
transform = CATransform3DRotate(transform, rotationAngleRadians, -50.0, 0.0, 1.0); | |
transform = CATransform3DTranslate(transform, offsetPositioning.x, offsetPositioning.y, -50.0); | |
cellContentView.layer.transform = transform; | |
cellContentView.layer.opacity = 0.8; | |
[UIView animateWithDuration:0.65 delay:00 usingSpringWithDamping:0.85 initialSpringVelocity:0.8 options:0 animations:^{ | |
cellContentView.layer.transform = CATransform3DIdentity; | |
cellContentView.layer.opacity = 1; | |
} completion:^(BOOL finished) {}]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment