title: Update UIView frame size inside a UITableView - swift
body: <p>I have a UIView inside a UITableView like this </p>
  
  <p><img src="https://i.stack.imgur.com/weOwQ.png" alt="enter image description here"></p>
  
  <p>The problem is when I try to resize height of my UIView programmatically ,the existing cells inside of UITableView didn't move up<br>
  i have been tried update 
  <code>UITableview size</code> ,</p>
  
  <pre><code>UITableviewwrapperview 
  </code></pre>
  
  <p>and I have been try update </p>
  
  <pre><code>TableView.contentInset
  
  TableView.contentOffset
  </code></pre>
  
  <p>size,remove Auto Layout and Auto Layout , but all same result.</p>
  
  <p>this is my code :</p>
  
  <pre><code>@IBAction func SwitchChanged(sender: UISwitch) {
  
          if sender.on {
              self.ViewBOX.frame.size.height =  self.ViewBOX.frame.size.height + 275
  
  
              var  Frame = self.TableView.tableHeaderView!.frame
              Frame.size.height = self.ViewBOX.frame.size.height;
              TableView.tableHeaderView?.frame = Frame
  
  
  
          } else {
             self.ViewBOX.frame.size.height =  self.ViewBOX.frame.size.height - 275
  
  
              var  Frame = self.TableView.tableHeaderView!.frame
              Frame.size.height = self.ViewBOX.frame.size.height;
              TableView.tableHeaderView?.frame = Frame
  
          }
  
      }
  </code></pre>
  
  <p>and this is result image </p>
  
  <p>1 :
  <img src="https://i.stack.imgur.com/HLyfg.png" alt="enter image description here"></p>
  
  <p>2 : after update </p>
  
  <p><img src="https://i.stack.imgur.com/Y5EQp.png" alt="enter image description here"></p>
  
  <p>Someone please help me and explain which part I missed .</p>
  
  <p>thanks</p>