title: Where to get frame size of custom UIView in its subclass
body: <p>When does the correct frame size of the UIView is calculated when I add my custom UIView by using storyboard? 
  I can't get correct frame size in <strong>UIView's</strong> <code>init(frame: CGRect)</code> or <code>init(coder aDecoder: NSCoder)</code> or <code>awakeFromNib()</code>. I get the correct size in <code>override func layoutSubviews()</code> but this time the view is not added to the view controller's view. </p>
  
  <p><strong>Edit:</strong><br>
  I want to do this in the UIView subclass because I add a <code>CAGradientLayer</code> layer (which has same size with my view) to my custom <code>UIView</code>. There must be a better way than setting up the view in <code>UIViewController</code>s <code>viewDidLayoutSubviews</code> method. </p>
  
  <p>There are two vertical constraints (trailing and leading space to superview) that adjust the width of my custom view. But the width is 600 in the mentioned methods, not the screen width.</p>