Animating height changes on cell content

We noticed a bug in our animations on the iOS 10 betas within

UITableView
cells: The cell's frame is animating, but the
contentView
's frame is immediately jumping to the new position.


This happens in iOS 10 devices when building against the iOS 9 SDK using Xcode 7 - the animation is fine on iOS 9 devices.

Steps to reproduce


  • Create a table view with
    UITableViewAutomaticDimension
  • Add a view to one of the cells with edge constraints
  • Animate
    intrinsicContentSize
    change to the view with
    animateWithDuration
    /
    layoutIfNeeded
  • Animate the cell height change with
    beginUpdates
    /
    EndUpdates

Animation code


UIView.animateWithDuration(0.3) { 
    viewToAnimate.setNeedsLayout()
    viewToAnimate.layoutIfNeeded() 
} 

self.tableView.beginUpdates()
self.tableView.endUpdates()


I've opened a radar for this (27679031) but are there are any good workarounds / alternative ways to achieve this animation?

Replies

Hi,


I'm seeing something similar with jumpiness when I change the height constraint with animation. Did you ever find a workaround?

ditto... got the same thing


@kellnr: Any response to your radar?

This issue has been resolved in iOS 10.2 (build 14C92).

This behavior still seem to be present for me on 10.2.1 (14D27)