title: UIActivityIndicatorView not spinning in UICollectionViewCell
body: <p>I have a custom cell that is loaded at the bottom of my collection view. Its only job is to display an activity indicator view - which happens while the app is making a new work call. </p>
  
  <p>So I added it to the cell like so: </p>
  
  <pre><code>BBLoaderCell *loaderCell = [collectionView dequeueReusableCellWithReuseIdentifier:@"LoaderCell" forIndexPath:indexPath];
  
  
  UIActivityIndicatorView * activityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
  activityIndicator.hidesWhenStopped = YES;
  activityIndicator.hidden = NO;
  activityIndicator.center = loaderCell.imageView.center;
  activityIndicator.tag = 10;
  
  [loaderCell.imageView addSubview:activityIndicator];
  
      [activityIndicator startAnimating];
      return loaderCell;
  </code></pre>
  
  <p>This shows an activity indicator in the last cell of my view - however it does not spin. Any ideas?</p>
  
  <p><strong>Solution Found</strong></p>
  
  <p>As per comments - it was a threading issue. I also took the suggestion to move the code to the custom nib file for the cell. </p>
  
  <p>here is the refactored code: </p>
  
  <pre><code>BBLoaderCell *loaderCell = [collectionView dequeueReusableCellWithReuseIdentifier:@"LoaderCell" forIndexPath:indexPath];
      loaderCell.backgroundColor = [UIColor clearColor];
  
       if (self.loadingMore == NO){
          dispatch_async(dispatch_get_main_queue(), ^{
              activityIndicator.hidden = YES;
              [loaderCell.spinner stopAnimating];
          });
      }
       else if (self.loadingMore == YES){
      dispatch_async(dispatch_get_main_queue(), ^{
          activityIndicator.hidden = NO;
          [loaderCell.spinner startAnimating];
      });
      }
  
      return loaderCell;
  </code></pre>
  
  <p>This is working as I need it to. </p>
  
  <p>Thanks guys! </p>