title: How to Set Dynamically UIScrollView height based on UITableView height?
body: <p>I'm able to give height of scrollview based on tableview content height but sometimes scrollview height is not scrolled and sometime scrollview height is giving me perfect height based on tableview , I'm confused its not giving me each and every time when I run app its not giving  perfect height based on tableview. And in my both tableview data are from Web and is it I'm not getting scrollview height based on tableview height because of Internet Slow so it is loading data slow in tableview ??</p>
  
  <pre><code>func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
  
          if tableView == tableview{
          let cell = tableview.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as! noticeTableViewCell
          let noticedata = notices[indexPath.row]
  
          cell.noticeText.text =  noticedata.notice
  
               tableviewheightConstraint.constant = tableView.contentSize.height
  //            scrollview.contentSize = CGSize(width: self.view.frame.size.width, height: tableview.frame.origin.y + tableView.contentSize.height )
  
              return cell
  
          } else  {
              let cell = pendingtableview.dequeueReusableCell(withIdentifier: "pendingbillcell", for: indexPath) as! PendingbillTableViewCell
  
              let getdata = pendingbillsdata[indexPath.row]
  
              let date = getdata.date
              let dateFormatter = DateFormatter()
  
              dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss"
              let dateFromString : NSDate = dateFormatter.date(from: date)! as NSDate
              dateFormatter.dateFormat = "dd-MM-yyyy"
              let datenew = dateFormatter.string(from: dateFromString as Date)
  
              cell.billnotext.text = getdata.Billno
              cell.datetext.text = datenew
              cell.amounttext.text = getdata.amount
              cell.statustext.text = getdata.status
  
              pendingtableviewheightConstraint.constant = tableView.contentSize.height
              scrollview.contentSize = CGSize(width: self.view.frame.size.width, height: pendingtableview.frame.origin.y + tableView.contentSize.height)
              return cell
          }
  
      }
  </code></pre>
  
  <p>Or do I missing something in code that I am not getting , can this issue be solved ?</p>