Search code examples
swiftnibuitableview

Making UITableViewCell from Nib


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?


Solution

  • 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