title: UIView frame not updated during traitCollectionDidChange
body: <p>I did some drawing using CALayer based on the frame in my subclass of UIView, I need to update the lines when the device rotate but in traitCollectionDidChange, the frame is still holding the value before the rotation. Is there a way to get the updated values of the frame after the rotation?</p>
  
  <p>My drawing codes looks like this, called in traitCollectionDidChange of it's view controller:</p>
  
  <pre><code>func setup() {
  
      layer.sublayers?.removeAll()
  
      let xAxisLine = UIBezierPath()
      xAxisLine.move(to: CGPoint(x: 100, y: frame.height))
      xAxisLine.addLine(to: CGPoint(x: bounds.width, y: frame.height))
      let xAxisLayer = CAShapeLayer()
      xAxisLayer.path = xAxisLine.cgPath
      xAxisLayer.lineWidth = 2
      xAxisLayer.fillColor = UIColor.clear.cgColor
      xAxisLayer.strokeColor = UIColor.black.cgColor
      layer.addSublayer(xAxisLayer)
  }
  </code></pre>
  
  <p>This part draws the X-Axis of my custom graph but more importantly the frame values are that of before the rotation thus the entire graph is out of place and size.</p>
  
  <p>From the view controller, I called it by:</p>
  
  <pre><code>override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
  
      super.traitCollectionDidChange(previousTraitCollection)
  
      barView.setup()
  }
  </code></pre>