title: How to add centered UIActivityIndicator for UICollectionView when using UICollectionViewController?
body: <p>I'v never used UITableViewControllers or UICollectionViewControllers, because you can have the same functionality by using UIViewController with its root UIView, then adding  UITableView in xib or storyboard and assigning its delegate and datasource. And I also was able to put activity indicator inside the center of root UIView. </p>
  
  <p>Now the things get a little bit complicated when using UICollectionViewController where its root view is UICollectionView. I need to update some code of other guys and they put activity indicator inside UICollectionView (in storyboard). The problem is this activity indicator gets hidden when cells are reused because activity indicator view is the most bottom one. I was unable to change visibility priority storyboard and also this code in view didLoad is not working:</p>
  
  <pre><code>[self.itemsCollectionView bringSubviewToFront:self.activityIndicator];
  </code></pre>
  
  <p>Because labels, images and etc. views of collection view cell are placed later, during  collectionView:cellForItemAtIndexPath:. I could try to call bringSubviewToFront: in collectionView:cellForItemAtIndexPath: but that would be a wrong decision. Any ideas how to achieve this when using UITableViewControllers or UICollectionViewControllers? </p>
  
  <p>IMHO the only reason to use UITableViewControllers or UICollectionViewControllers is  because static cells are not shown storyboards when designing layout.</p>
  
  <p><strong>UPDATE</strong> It appears iOS wraps UICollectionView inside UICollectionViewControllerWrapperView. Tried to add activity to this wrapper view in viewWillAppear:</p>
  
  <pre><code>[self.itemsCollectionView.superview addSubview:self.activityIndicator];
  </code></pre>
  
  <p>But with no luck - activity indicator is still is below the cells.</p>