title: @IBDesignable error: IB Designables: Failed to update auto layout status: Interface Builder Cocoa Touch Tool crashed
body: <p>I have a very simple subclass of UITextView that adds the &quot;Placeholder&quot; functionality that you can find native to the Text Field object. Here is my code for the subclass:</p>
  <pre><code>import UIKit
  import Foundation
  
  @IBDesignable class PlaceholderTextView: UITextView, UITextViewDelegate
  {
      @IBInspectable var placeholder: String = &quot;&quot; {
          didSet {
              setPlaceholderText()
          }
      }
      private let placeholderColor: UIColor = UIColor.lightGrayColor()        
      private var textColorCache: UIColor!
      
      override init(frame: CGRect) {
          super.init(frame: frame)
          self.delegate = self
      }
      
      required init(coder aDecoder: NSCoder) {
          super.init(coder: aDecoder)
          self.delegate = self
      }
      
      func textViewDidBeginEditing(textView: UITextView) {
          if textView.text == placeholder {
              textView.text = &quot;&quot;
              textView.textColor = textColorCache
          }
      }
      
      func textViewDidEndEditing(textView: UITextView) {
          if textView.text == &quot;&quot; &amp;&amp; placeholder != &quot;&quot; {
              setPlaceholderText()
          }
      }
      
      func setPlaceholderText() {
          if placeholder != &quot;&quot; {
              if textColorCache == nil { textColorCache = self.textColor }
              self.textColor = placeholderColor
              self.text = placeholder
          }
      }
  }
  </code></pre>
  <p>After changing the class for the <code>UITextView</code> object in the Identity Inspector to <code>PlaceholderTextView</code>, I can set the <code>Placeholder</code> property just fine in the Attribute Inspector. The code works great when running the app, but does not display the placeholder text in the interface builder. I also get the following non-blocking errors (I assume this is why it's not rendering at design time):</p>
  <blockquote>
  <p>error: IB Designables: Failed to update auto layout status: Interface Builder Cocoa Touch Tool crashed</p>
  <p>error: IB Designables: Failed to render instance of PlaceholderTextView: Rendering the view took longer than 200 ms. Your drawing code may suffer from slow performance.</p>
  </blockquote>
  <p>I'm not able to figure out what is causing these errors. The second error doesn't make any sense, as I'm not even overriding drawRect(). Any ideas?</p>