So I have a table that when a user hits "search" I want to collapse all the cells down to a height of 45, the user can then scroll and tap a cell in the table view which will exit the search state expanding the cells back to their original heights. The expanded heights of the cells can be dynamic based on the amount of text in a UITextView. I have setup autolayout constraints and the expanded view works well, but when I attempt to collapse the cells to a height of 45 from heightForRowAtIndexPath, I get autolayout constraint errors. Does anyone know how to setup the constraints so the cell can be sized down to a height of 45 but have a dynamic heights > 45 allowing it to fit the button and UITextView contents? Also I am using beginUpdates,endUpdates to animate the height changes, so I don't want to do a full table reload if at all possible.
Example of an expanded view layout sizes to fit the content of UITextView.
UILabel 1
UILabel 2
UITextView
UIButton
Example of collapsed view.
UILabel 1
UILabel 2