title: iOS - get frame of UIView at runtime which was created with Interface Builder
body: <p>I'm working on my app which uses a graph to visualize some data. I'm using this nice Scrollable-GraphView for that: <a href="https://github.com/philackm/Scrollable-GraphView" rel="nofollow">https://github.com/philackm/Scrollable-GraphView</a></p>
  
  <p>Because this is only a class which inherits from UIScrollView, it's not possible to use it with Interface Builder (it also doesn't have the init(withCoder:) function implemented).</p>
  
  <p>I now want to add a UIView with Interface Builder, which has all the necessary constraints to be sized properly at runtime. How can I "replace" that UIView with my GraphView at runtime?</p>
  
  <p>This method is used for creating my graph at runtime:</p>
  
  <pre><code>private func createDarkGraph(frame: CGRect) -&gt; ScrollableGraphView {
      let graphView = ScrollableGraphView(frame: frame)
  
      // ... some customization
  
      return graphView
  }
  </code></pre>