title: How to display ads within a collection view
body: <p><strong>I'm trying to add some banner ads randomly inside my collectionView.</strong></p>
  
  <p>Each collectionView cell would be a basic image (black square here to make things easier) populated dynamically from an array (let's say it's a really long array and call it "longDataArray") that I would get from the web.</p>
  
  <p>I could manage to add some banner ads to my collectionView but the problem is that it's breaking the order of my longDataArray. 
  For example, just for testing when I'm adding an ad banner at indexPath 6, then the ad banner correctly shows up at indexPath 6, and I'm able to manage the width change for the cell, <strong>but</strong> the image corresponding at the indexPath 6 for my longDataArray would obviously never appears.</p>
  
  <p>I also could do it spliting my longDataArray in two, and then playing with the sections : section 0 = firstPartOfArray, section 1 = ad banner, and section 2 = secondPartOfArray. But this takes a lot of effort creating differents arrays and sections, just to add only one ad banner, and it's obviously not what I'm looking for.</p>
  
  <p><strong>So my question is, how would you add banner ad within your collectionView (only one section), but keeping the indexPath logic ?</strong></p>
  
  <p>I googled a lot about that, and was surprised that I could not come up with any solution for this problem.</p>
  
  <p>Do you guys have any idea ?</p>
  
  <p>Thanks!</p>
  
  <p><a href="https://i.stack.imgur.com/Do8pE.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Do8pE.png" alt="screenshot"></a></p>