When I'm changing a cell height with animation (using beginUpdates(), endUpdates()) I'm having a very weird animation for my section footer : it's moving at the bottom of the tableview.
here is the simplest code i could write
func tableView(tableView: UITableView, titleForFooterInSection section: Int) -> String? {
return "footer"
}
func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
return cellHeight
}
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 1
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
return tableView.dequeueReusableCellWithIdentifier("cell", forIndexPath: indexPath) as UITableViewCell
}
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
tableView.beginUpdates()
cellHeight += 20;
tableView.endUpdates()
}
How could I avoid this animation issue ?
I'm having the exact same problem (the footer moves to the bottom of the tableview and stays there). It looks like it's an iOS8 bug (it doesn't happen on iOS7).
In my case, a workaround is to return the footer as the next section header...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With