TableView height is not adopting dynamic size

76 Views Asked by At

I have table view in which I have another table view. Actually I make dynamic section with cells coming from backend.

The problem is that is not showing the last cell.

Here is the main table view height setting:

enter image description here

//This code is in first view controller updating table view height

override func updateViewConstraints() {
    tableViewHieght.constant = tableView.contentSize.height
    super.updateViewConstraints()
}

override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) 
{
    tableView.layer.removeAllAnimations()
    tableViewHieght.constant = tableView.contentSize.height
    UIView.animate(withDuration: 0.5) {
        self.updateViewConstraints()
    }
}

Add picture for more clarification

I don't know what I should do for second table view that is in cell so it adopt the dynamic size.

The actual output:

enter image description here

I work on it and i realised the problem is with first table view row height i inspect the constraint and all settings that is necessary for making it dynamic but still it not growing i did a lil hack but i really want to do it with tableview.automatic dimension // this is first table view cell in that cells every cell contain a label and a table view a second one which contain some label that making a format like section and cells In second table view I used Table view.automatic dimension

enter image description here

0

There are 0 best solutions below