title: Why width of view always return zero?
body: <p>I'm setting up a view programmatically with all the constraints. Then I want to get its width (which vary from a device to another) but it always return zero when I print it.</p>
  
  <p>here is my code:</p>
  
  <pre><code>let myView = UIView()
  view.addSubview(myView)
  myView.translatesAutoresizingMaskIntoConstraints = false
  myView.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 15).isActive = true
  myView.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -15).isActive = true
  myView.topAnchor.constraint(equalTo: view.topAnchor, constant: 80).isActive = true
  myView.bottomAnchor.constraint(equalTo: view.bottomAnchor, constant: -60).isActive = true
  myView.backgroundColor = .blue
  
  let myWidth1 = myView.frame.size.width
  let myWidth2 = myView.bounds.width
  print(myWidth1)
  print(myWidth2)
  </code></pre>
  
  <p>however, the view actually has a width as shown in this screenshot:</p>
  
  <p><a href="https://i.stack.imgur.com/CF7UZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CF7UZ.png" alt="enter image description here"></a></p>