title: How to remember text attributes in UITextView when the user starts typing
body: <p>I'm using a <code>UITextView</code> and I'm trying to have the text displayed using the <code>attributedText</code> property as the user types. </p>
  
  <p>Here's my current code:</p>
  
  <pre><code>textView.attributedText = NSMutableAttributedString(
      string: "",
      attributes: [
          NSFontAttributeName: UIFont(name: "AvenirNextLTPro-Regular", size: 12.5)!,
          NSForegroundColorAttributeName: UIColor.colorFromCode(0x262626),
          NSKernAttributeName: 0.5,
          NSParagraphStyleAttributeName: paragraphStyle
      ]
  )
  </code></pre>
  
  <p>The problem is that if you supply an empty string, when the user starts typing, the text isn't being formatted with the <code>attributedText</code> properties. </p>
  
  <p>However, I noticed if I supply a string, as the user begins to append that string, the text is formatted with the <code>attributedText</code> properties.</p>
  
  <p>The only way I can think to accomplish what I need would be to override this function and set the text to attributedText everytime a user enters a key:</p>
  
  <pre><code>func textView(textView: UITextView, shouldChangeTextInRange range: NSRange, replacementText text: String) -&gt; Bool
  </code></pre>
  
  <p>Is there no other better way to do this?</p>