Dynamic Row Height in a TableView (Swift 2.2, Xcode 7)

Video is ready, Click Here to View ×

In this video I show how to create dynamic row heights in a tableview. You will see how to layout a label and tableview in a stack panel and add data to a tableview. Then I will show you how to change the height of the cells/rows depending on the length of the text in the cell.

This is my first tutorial video so any constructive criticism is welcome!

Note: You actually don’t need this line of code:
tableView.estimatedRowHeight = 44

But it helps with performance. Here’s what Apple says about estimatedRowHeight:
“Providing a nonnegative estimate of the height of rows can improve the performance of loading the table view. If the table contains variable height rows, it might be expensive to calculate all their heights when the table loads.”

Patreon: https://www.patreon.com/bigmountainstudio

xcode tutorials swift


Leave a Reply

Your email address will not be published. Required fields are marked *