Making UITableViewCell from Nib

352 views Asked by At

I'm trying create UITableViewCell from Nib. So my xib. file looks like:

enter image description here

How change height of each row of my tableView depends of content size?

1

There are 1 answers

1
Nikita Patskov On BEST ANSWER

Look at great tutorial: https://www.raywenderlich.com/129059/self-sizing-table-view-cells Its for autolayout-way. But delegate method

func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
    //code
}

is much more preferred cause its REAL faster. Look here: https://medium.com/ios-os-x-development/perfect-smooth-scrolling-in-uitableviews-fd609d5275a5#.i439tyds6