Iam having a UItableview which is populated from array and a drop down list. If i select any row of drop down list the array will be inserted with new values and tableview should reload. How to animate the tableview with new array contents ? thanks in advance
animation like i want to show the row one by one . i tried this method
- (void)reloadRowsAtIndexPaths:(NSArray )indexPaths withRowAnimation:(UITableViewRowAnimation)animation {
NSIndexPath rowToReload = [NSIndexPath indexPathForRow:[names count] inSection:0];
NSArray* rowsToReload = [NSArray arrayWithObjects:rowToReload, nil];
[tableDetails reloadRowsAtIndexPaths:rowsToReload withRowAnimation:UITableViewRowAnimationNone];
}
In Swift 3 you can simply add the following
extension
toUITableView
:use this method,
Swift 3
Swift 2
I went with this in Swift
To add to the correct answer, if you want to reload all sections in your
UITableView
you will need to do the following:ObjC
Swift
This will reload everything in the table view with an animation. Like a boss.
you can use
reloadSections:withRowAnimation:
functions. Check UITableView Class Reference.Check this reloadData with Animation which already answered your question.
Below method is supported by tableView for animation :
Usage :
Different types of animation available are :
Hope this might help!