How to resize the height of tableview ? I can achieve ,when the screen is initially loaded. But when we add data in add screen . we traverse from add screen to display screen. Height of the tableview not reflected. when I close the application and reopened the height get changed. Only the height of tableview is not reflected.But the data got reflected.
 func tableSize(count:Int,tableView:UITableView) {
        switch count {
            case 0:
                    tableView.heightAnchor.constraint(equalToConstant: 80).isActive = true
            case 1:
                    tableView.heightAnchor.constraint(equalToConstant: 95).isActive = true
            case 2:
                    tableView.heightAnchor.constraint(equalToConstant: 115).isActive = true
            case 3:
                    tableView.heightAnchor.constraint(equalToConstant: 155).isActive = true
            case 4:
                    tableView.heightAnchor.constraint(equalToConstant: 200).isActive = true
            default:
                    tableView.heightAnchor.constraint(equalToConstant: 250).isActive = true
        }
        tableView.layer.borderColor = UIColor.blue.cgColor
        tableView.layer.borderWidth = 1.0
    }
 
    