Last active
December 20, 2015 08:49
-
-
Save swarut/6103245 to your computer and use it in GitHub Desktop.
Objective-C : Show table insertation with delay for animation.
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
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