title: Is there a way to hide the footer of UITableView?
body: <p>I have a table view that is inside a viewcontroller, the tableview resizes according to the dynamic cells, sometimes there are only 1 rows, sometimes more, the problem is that the footer of the tableview occupies a lot of space, i want the footer to hide, i tries using the delegate method viewForFooterInSection, and also setting the footer height to 0 in viewdidload method, and to 1.0 in heightForFooterInSection, and the footer is still showing, here is a photo of the tableview, i made the footer background black to check where is it</p>
  
  <p><a href="https://i.stack.imgur.com/wX1ep.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wX1ep.png" alt="enter image description here"></a>
  this is the code i use in viewdidload:</p>
  
  <pre><code>override func viewDidLoad() {
      super.viewDidLoad()
      let notificationName = Notification.Name(rawValue: "ErrorGettingReportDetail")
      NotificationCenter.default.addObserver(self, selector: #selector(self.mostrarErrorDetalle), name: notificationName, object: nil)
      // Do any additional setup after loading the view.
      /*self.backView.layer.cornerRadius = 10
      self.backView.layer.masksToBounds = true*/
  
      self.backScrollView.layer.cornerRadius = 10
      self.backScrollView.layer.masksToBounds = true
  
      self.commentTextView.delegate = self
      let tap: UITapGestureRecognizer = UITapGestureRecognizer(target: self, action: "dismissCommentsPopUp")
      view.addGestureRecognizer(tap)
  
      self.tagsTableView.dataSource = self
      self.commentTextView.autocorrectionType = .no
  
      self.tagsTableView.estimatedRowHeight = 40
      self.tagsTableView.rowHeight = UITableViewAutomaticDimension
  }
  </code></pre>
  
  <p>and this is the code i use for the tableview:</p>
  
  <pre><code>//MARK: -TagsTableView
  func numberOfSections(in tableView: UITableView) -&gt; Int {
      return 1
  }
  
  func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
      if(self.reporte != nil){
          if((self.reporte?.atributosInfo?.count)! &gt; 0){
              return (self.reporte?.atributosInfo?.count)!
          }else{
              //self.tagsTableView.isHidden = true
              return 0
          }
      }else{
          return 0
      }
  }
  
  func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
      if(KRProgressHUD.isVisible){
          KRProgressHUD.dismiss()
      }
      if(self.reporte != nil){
          let cell = tableView.dequeueReusableCell(withIdentifier: "atributoCell") as! AtributoTableViewCell
          let atributosInfo = self.reporte?.atributosInfo![indexPath.row]
          cell.configureCellWith(atributoInfo: atributosInfo!)
          cell.atributo = atributosInfo
          print(indexPath.row)
          let height = cell.frame.height
          self.tagsTableViewHeight.constant += height
          return cell
      }else{
          let cell = UITableViewCell()
          //self.tagsTableViewHeight.constant -= cell.frame.height
          return cell
      }
  }
  
  func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -&gt; CGFloat {
      return 100
  }
  
  //MARK END
  </code></pre>
  
  <p>any help will be appreciated.</p>