Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save waveacme/ed00e594afcfc66cb9e4a81c27ac22c0 to your computer and use it in GitHub Desktop.
Save waveacme/ed00e594afcfc66cb9e4a81c27ac22c0 to your computer and use it in GitHub Desktop.
tableview重载数据时的淡入淡出动画过渡效果
#import "UITableView+reloadDataAnimated.h"
@implementation UITableView (reloadDataAnimated)
- (void)reloadDataWithAnimated:(BOOL)animated
{
[self reloadData];
if (animated) {
CATransition *animation = [CATransition animation];
[animation setType:kCATransitionFade];
[animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut]];
[animation setDuration:0.3];
[[self layer] addAnimation:animation forKey:@"UITableViewReloadDataAnimationKey"];
}
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment