title: UITextView subclass as delegate of itself
body: <p>Let's say I add a <code>UITextView</code> to my <code>UIView</code>, and I want it to change its background color each time the contents change. I can do this by becoming the delegate of the <code>UITextView</code> and implementing <code>textViewDidChange</code>.</p>
  
  <p>If I am using this behavior frequently though, it makes sense to create a <code>UITextView</code> subclass, which I will call <code>ColorSwitchingTextView</code>. It should include the color-switching behavior by default, so that any <code>UIView</code> can simply add it instead of a standard <code>UITextView</code> if it wants that behavior.</p>
  
  <p>How do I detect changes in the content from within my <code>ColorSwitchingTextView</code> class? I don't think I can do something like <code>self.delegate = self</code>. </p>
  
  <p>In summary, how can a <code>UITextView</code> subclass know when its contents change?</p>
  
  <p>EDIT
  It seems I can use <code>self.delegate = self</code>, but this means that the UIViewController that uses the <code>ColorSwitchingTextView</code> can not also subscribe to the notifications. Once I use <code>switchingTextView.delegate = self</code> in the view controller, the subclass behavior no longer works. Any workarounds? I'm trying to get a custom <code>UITextView</code> that otherwise works like a regular <code>UITextView</code>.</p>