title: NSTextView inside NSView and NSScrollView
body: <p>My goal is to make a view that is similar to the Goole Docs text editor, with comment highlighting behind the text where there are comments.
  <a href="https://i.stack.imgur.com/kwwRD.png" rel="noreferrer"><img src="https://i.stack.imgur.com/kwwRD.png" alt="Highlight"></a></p>
  
  <p>My solution is to have an <code>NSScrollView</code> containing an <code>NSView</code> (set as the document view) that scrolls and contains both an <code>NSTextView</code> of the text, and other <code>NSView</code>s that will be the highlights. </p>
  
  <p>For this to work, the <code>NSTextView</code> has to size as if it belongs directly to the <code>NSScrollView</code>. However, I cannot make the <code>NSTextView</code> have this behavior. </p>
  
  <p>The code I have for the layout is:</p>
  
  <p><em><strong>LatinViewController:loadView()</strong></em></p>
  
  <pre><code>...
  let latinView = LatinView()
  latinView.autoresizingMask = [.ViewWidthSizable]
  latinView.wantsLayer = true
  latinView.layer?.backgroundColor = Theme.greenColor().CGColor
  self.latinView = latinView
  scrollView.documentView = latinView
  ...
  </code></pre>
  
  <p><em><strong>LatinView:init()</strong></em></p>
  
  <pre><code>...
  let textView = LatinTextView()
  textView.translatesAutoresizingMaskIntoConstraints = false
  textView.string = "Long string..."
  self.addSubview(textView)
  self.textView = textView
  
  self.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("H:|[text]|", options: NSLayoutFormatOptions(), metrics: nil, views: ["text": textView]))
  self.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("V:|[text]|", options: NSLayoutFormatOptions(), metrics: nil, views: ["text": textView]))
  ...
  </code></pre>
  
  <p><em><strong>LatinTextView:init()</strong></em></p>
  
  <pre><code>...
  self.minSize = NSMakeSize(0, 0)
  self.maxSize = NSMakeSize(0, CGFloat(FLT_MAX))
  self.verticallyResizable = true
  self.horizontallyResizable = false
  self.textContainer?.heightTracksTextView = false
  ...
  </code></pre>
  
  <p>Can this be done?</p>