My UITableViewCell will animate it\'s height when recognizing a tap. In iOS 9 and below this animation is smooth and works without issues. In iOS 10 beta there\
So I had this issue for a UITableViewCell that used layout constraints and a UITableView that used automatic cell heights (UITableViewAutomaticDimension). So I'm not sure how much of this solution will work for you but I'm putting it here as it's closely related.
The main realisation was to lower the priority of the constraints that cause the height change to happen:
self.collapsedConstraint = self.expandingContainer.topAnchor.constraintEqualToAnchor(self.bottomAnchor).priority(UILayoutPriorityDefaultLow)
self.expandedConstraint = self.expandingContainer.bottomAnchor.constraintEqualToAnchor(self.bottomAnchor).priority(UILayoutPriorityDefaultLow)
self.expandedConstraint?.active = self.expanded
self.collapsedConstraint?.active = !self.expanded
Secondly, the way in which I animate the tableview was very specific:
UIView.animateWithDuration(0.3) {
let tableViewCell = tableView.cellForRowAtIndexPath(viewModel.index) as! MyTableViewCell
tableViewCell.toggleExpandedConstraints()
tableView.beginUpdates()
tableView.endUpdates()
tableViewCell.layoutIfNeeded()
}
Note that the layoutIfNeeded() had to come AFTER beginUpdates/endUpdates
I think this last part might be helpful to you....