I'm making a tableView programmatically like this
tableView = UITableView.init(frame: CGRectZero, style: .Plain)
tableView.delegate = self
tableView.dataSource = self
self.view = tableView
Then I'm setting its rowHeight value to
tableView.estimatedRowHeight = 250
tableView.rowHeight = UITableViewAutomaticDimension
Each cell is described in separate .swift-file and each of them has function 'construct()' which builds its own content (labels, buttons, etc.), here is the piece of their code
let btnControl = UIButton()
btnControl.frame = CGRectMake(avatar.frame.origin.x, avatar.frame.origin.y + avatar.frame.size.height + 10, screenWidth - 20, 30)
self.addSubview(btnControl)
At the end it looks like
So what's the problem?