title: iOS Detect subviews being added to UIViewContoller's view
body: <p>I have a <code>scrollView</code> to which custom views are being added and removed in response to user interaction. I want to make sure the container view is always big enough to display all the subviews, and would like to detect when a view was added or removed. I tried using KVO:</p>
  
  <pre><code>[self.scrollView addObserver:self forKeyPath:@"subviews" options:NSKeyValueObservingOptionNew context:nil];
  </code></pre>
  
  <p>But while there was no error, <code>observeValueForKeyPath:...</code> method never gets called when the number of subviews change. What should I use instead?</p>
  
  <p>P.S. I know I could put the calculation of desired <code>contentSize</code> property directly into the methods that add/remove subviews to scrollView, but for architectural reasons, this option is inferior to me and I'd prefer to something like KVO instead. Are there options like this?</p>