title: Observing number of selected cells in UICollectionView
body: <p>I want to use KVO to be notified when the number of selected cells in a UICollectionView changes. When I tried to subclass <code>UICollectionView</code> and add a new property <code>nSelectedCells</code>, I ran into a problem when trying to add the logic that updates <code>nSelectedCells</code>. There are too many places where the selected cells count can change:</p>
  
  <ul>
  <li>Programmatically - View: <code>deselectItemAtIndexPath</code>, <code>selectItemAtIndexPath</code>, <code>reloadData</code>, ...</li>
  <li>UI - Controller: <code>didDeselectItemAtIndexPath</code>, <code>didSelectItemAtIndexPath</code></li>
  <li>More?</li>
  </ul>
  
  <p>What would be the best way to keep track of this value. Preferably from within the <code>UICollectionView</code> subclass. </p>