title: Container View bounds issue in Swift
body: <p>I'm writing a function which can get the height and width of the container view:</p>
  
  <pre><code>// container view's UIViewController
  class SelectionView: UIViewController {
  
      override func viewDidLoad() {
          super.viewDidLoad()
      }
  
      func getBounds -&gt; (CGFloat,CGFloat){
          let x = self.view.bounds.width / 5
          let y = self.view.bounds.height / 15
          return x,y
      }
  
  }
  </code></pre>
  
  <p>I write a button to call this getBounds() and it works well, but when I put it in the viewDidLoad() function</p>
  
  <pre><code>override func viewDidLoad() {
      super.viewDidLoad()
      getBounds()
  }
  </code></pre>
  
  <p>getBounds() returns me different height and width and it is clearly not the bounds of this container view.</p>
  
  <p>I'm pretty sure I've linked this class to the container view!</p>