How to make Dynamic Row Height in a TableView (iOS, Swift 2.2, Xcode 7)

Опубликовано: 10 Октябрь 2024
на канале: Mark Moeykens
25,711
216

🌐 https://www.bigmountainstudio.com

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."

🛠 Code: https://www.bigmountainstudio.com/exp...
👉 Find out the Ugly Truth of SwiftUI: https://www.bigmountainstudio.com/ugl...

📙 FREE SwiftUI PictureBook: https://www.bigmountainstudio.com/fre...
🎦 Getting Started With CollectionViews: https://www.pluralsight.com/courses/i...

#SwiftUI #Swift #bigmountainstudio