1

Once a UIButton is clicked, the contents of a UITableView are changed by UITableView.reloadData() method.

What I want to do further is to change is reloading animation. I want the data to change immediately. Currently, the animation is the same as "Cross Dissolve" of trasition of view controllers; the former one fades out and then the reloaded data slightly shows up.

I cannot find such option to change animation in attributes inspector. How can I handle this problem if I can? Does is need to be managed programmatically?

It would be great if you give me some clues in Swift, not Objective C.

Yeongchan Jeon
  • 499
  • 3
  • 18

1 Answers1

2

you can try this :-

let range = NSMakeRange(0, self.tableView.numberOfSections)
let sections = NSIndexSet(indexesInRange: range)
self.tableView.reloadSections(sections, withRowAnimation: .Automatic)

and .Automatic , .Left, .Right, .Bottom , .Top , .Fade etc are the default Animations

Subhash Sharma
  • 745
  • 6
  • 24
  • There are several options to change its animation but nothing makes the table changes immediately though. Even 'None' doesn't work properly; if the numbers of rows in the former table and the latter are different, it looks like the rows move – Yeongchan Jeon Jul 27 '16 at 05:22