title: how to change view controller width size programatically?
body: <p>I am trying to make a <code>viewcontroller</code> manually without using pod following this tutorial <a href="https://www.youtube.com/watch?v=Hl_Re_KLhcY&amp;t=141s" rel="nofollow noreferrer">https://www.youtube.com/watch?v=Hl_Re_KLhcY&amp;t=141s</a></p>
  
  <p><a href="https://i.stack.imgur.com/9Xi1s.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9Xi1s.png" alt="enter image description here"></a></p>
  
  <p>but the <strong>sideMenuVC</strong> (the green one) has width that set accurately, I mean, the sideMenuVC should be 80% of the size of <strong>MainMenuVC</strong>. so if I change from iPhone 5s to iPhoneX, the <code>autolayout</code> still look perfect. But this is what I get</p>
  
  <p><a href="https://i.stack.imgur.com/Bl5tk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Bl5tk.png" alt="enter image description here"></a></p>
  
  <p>the sideMenuVC should be 80% only, but it looks full size on iPhone 5s</p>
  
  <p>in sideMenuVC <code>viewDidLoad</code> I want to set something like this</p>
  
  <pre><code>class SideMenuVC: UIViewController {
  
      @IBOutlet var sideMenu: UIView!
  
      override func viewDidLoad() {
          super.viewDidLoad()
          sideMenu.frame.width = self.view.frame.width / 2
         }
  }
  </code></pre>
  
  <p>but it doesn't work since it is get only property</p>
  
  <p>so I want to change the width in here
  <a href="https://i.stack.imgur.com/W90Kp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/W90Kp.png" alt="enter image description here"></a></p>