title: NSTextView Scrolling
body: <p>How to make a <code>NSTextView</code> scrollable ?</p>
  
  <h1>Problem:</h1>
  
  <ul>
  <li>Text View is displayed but is not scrollable. I have to resize the window to see more contents</li>
  </ul>
  
  <h1>Question:</h1>
  
  <ul>
  <li>How to make the text view scrollable.</li>
  </ul>
  
  <h1>Code:</h1>
  
  <pre><code>class ViewController: NSViewController {
  
      private let textView                = NSTextView()
  
      //MARK: Manage Views
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
          setupTextView()
      }
  
  
      private func setupTextView() {
  
          textView.isEditable      = false
  
          view.addSubview(textView)
  
          textView.translatesAutoresizingMaskIntoConstraints = false
  
          textView.leadingAnchor.constraint(equalTo: view.leadingAnchor).isActive = true
          textView.trailingAnchor.constraint(equalTo: view.trailingAnchor).isActive = true
          textView.topAnchor.constraint(equalTo: view.topAnchor).isActive = true
          textView.bottomAnchor.constraint(equalTo: view.bottomAnchor).isActive = true
      }
  }
  </code></pre>