Uitableview Has Unwanted Animation When Reloaddata Is Called

Unwanted UITableView reload animation when navigating from iOS 11 search controller

Personally, I would simply hide the searchView controller before presenting the new view controller.
( Using UIView.animates with a completion handler for example )

I would not try to investigate further because since iOS11, there is an esoteric problem in the safe area management. A bug ? :)

Even the launch screens layouts are not correctly handled.
So many majors logos miss their middle part at launch !

Unwanted UITableView reload animation when navigating from iOS 11 search controller

Personally, I would simply hide the searchView controller before presenting the new view controller.
( Using UIView.animates with a completion handler for example )

I would not try to investigate further because since iOS11, there is an esoteric problem in the safe area management. A bug ? :)

Even the launch screens layouts are not correctly handled.
So many majors logos miss their middle part at launch !

tableView.reloadData() ends other animations, how to fix it?

You need to use animation block to achieve this one. Try this one :-

UIView.animateWithDuration(0.3, delay: 0,
options: [], animations: {
toDoItems.removeAtIndex(index)
// use the UITableView to animate the removal of this row
tableView.beginUpdates()
let indexPathForRow = NSIndexPath(forRow: index, inSection: 0)
tableView.deleteRowsAtIndexPaths([indexPathForRow], withRowAnimation: .Fade)
tableView.endUpdates()
// refresh gradient effect of rows

}, completion: { _ in
tableView.reloadData()
})

Set duration as you want.( 0.3 or what you want )

Calling tableView.reloadData() removes custom in-cell animation

You do not need to reload the tableview if data on the labels change, just change the text on the labels. You need only to reload the tableview if e.g. the count of rows changes or you need to re-create the cells.

Just get the index paths of the visible rows with tableView.indexPathsForVisibleRows and iterate over the visible cells to change text or background.

Animated reloadData on UITableView

I did category method.

- (void)reloadData:(BOOL)animated
{
[self reloadData];

if (animated) {

CATransition *animation = [CATransition animation];
[animation setType:kCATransitionPush];
[animation setSubtype:kCATransitionFromBottom];
[animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
[animation setFillMode:kCAFillModeBoth];
[animation setDuration:.3];
[[self layer] addAnimation:animation forKey:@"UITableViewReloadDataAnimationKey"];

}
}


Related Topics



Leave a reply



Submit