title: How can you tell a device has rotated so you can reload a UICollectionView
body: <p>I want to <code>invalidateLayout()</code> of the custom UICollectionView when the bounds are changed. I know that I can call this method from the controller using <code>viewWillLayoutSubviews()</code>. But since I want to make this custom UICollectionView as a framework, I want to implement the function <strong>without</strong> being dependent to the controller.</p>
  
  <p>If I try to <code>invalidateLayout()</code> inside <code>override open func layoutSubviews()</code> then I get an infinite loop.</p>
  
  <p>What is the best way to implement what I want with the constraints give?</p>