I have an issue which is bothering me for a while. How can I set an automatic height for a tableview which is inside another tableview cell?
So I'm having MainTableView with 3 cells inside it (this tableview has automatic height) and on the 3rd cell I have another tableView inside it (let's call it SecondaryTableView which has constraints to its superview)
Thing is for the first 2 cells the automatic height it's working.
For the setups of the SecondaryTableView I've tried to do the same but for the cells I've opted for xib files.
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
tableView.dataSource = self
tableView.delegate = self
tableView.estimatedRowHeight = 900
tableView.rowHeight = UITableView.automaticDimension
registerCells()
}
private func registerCells() {
tableView.register(UINib(nibName: "MainCategorySectionTableViewCell", bundle: nil), forCellReuseIdentifier: "MainCategorySectionTableViewCell")
tableView.register(UINib(nibName: "AdPerHomePageTableViewCell", bundle: nil), forCellReuseIdentifier: "AdPerHomePageTableViewCell")
}
I've attached one more picture of how it looks in the simulator. The green color is the first cell and the orange one the second ( those registered). I've scrolled a little for the first 2 cells to see the difference.
Might it be that no data is on the cell? But I've put some labels and it looks the same