title: Changing UICollectionView cell image at regular interval
body: <p>I am developing an IOS 10.x application using UICollectionView and would like to change the image of specific cells, at regular interval.</p>
  
  <p>The code below shows the current implementation. Even though it should change  the cell background image every half of second, it changes the images immediately disregarding the NSThread SleepAt interval of 0.5 seconds.</p>
  
  <p>I suspect something about the main thread handling or the ReloadItem method but hasn't reached a clear conclusion. Any insight is very welcome! Thank you.</p>
  
  <pre><code>NSNumber* originalCardSelected;
  int position;
  
  for (int i = 0; i &lt; [opponentOriginalCardArray count]; i++) {
  
    originalCardSelected = [opponentOriginalCardArray objectAtIndex:i];
    position = [self convertLevelDataPositionToCellViewPosition:[originalCardSelected intValue]];
  
    NSMutableArray *tmpBackgroundAssets = [self getNewAssetBackgroundBasedOnBackgroundType:playbackBackground Index:position];
      self.backgroundAssets = tmpBackgroundAssets;
  
      dispatch_async(dispatch_get_main_queue(), ^{
  
  
  
          [collectionViewRoot reloadItemsAtIndexPaths:[collectionViewRoot indexPathsForVisibleItems]];
      });
      [NSThread sleepForTimeInterval:0.5];
  
  
  }
  </code></pre>