I’ve been working on a little prototype for something and wanted to have table cells that expand or collapse their height when you tap on them.
I just discovered this post, which taught me a bit of simple magic that I thought was worth sharing.
If you simply need to animate the change in a cell’s height (but don’t need to change its data or cell itself), you can simply call:
That’s it. No reloadRowsAtIndexPaths: withRowAnimation: . You should call that if you need to update your content, or if you need to show a different cell for that expanded or collapsed state.