Skip to content

Instantly share code, notes, and snippets.

@swarut
Last active December 20, 2015 08:49
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 swarut/6103245 to your computer and use it in GitHub Desktop.
Save swarut/6103245 to your computer and use it in GitHub Desktop.
Objective-C : Show table insertation with delay for animation.
if (weakSelf.followers.count==1) {
[weakSelf.tableView reloadData];
}else {
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0];
[weakSelf.tableView insertRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
// refresh index path
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.5 * NSEC_PER_SEC), dispatch_get_current_queue(), ^{
[weakSelf.tableView reloadData];
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment