Guest User

TableBounceList -Dhiru

a guest
Jun 5th, 2017
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
  2. {
  3.     CGRect original = cell.contentView.frame;
  4.     CGRect initalFrame=original;
  5.     CGRect bounce_offset = original;
  6.    
  7.    
  8.     initalFrame.origin.y += 100.0f;
  9.    
  10.     cell.contentView.frame = initalFrame;
  11.    
  12.     [UIView animateWithDuration:0.5f delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{
  13.         cell.contentView.frame = bounce_offset;
  14.     } completion:^(BOOL finished) {
  15.         [UIView animateWithDuration:1.0f delay:0.0f usingSpringWithDamping:0.75f initialSpringVelocity:0.0f options:UIViewAnimationOptionCurveEaseOut animations:^{
  16.             cell.contentView.frame = original;
  17.         } completion:^(BOOL finished) {
  18.            
  19.         }];
  20.     }];
  21.    
  22.  
  23. }
Add Comment
Please, Sign In to add comment