0

In lots of apps that have a feed every now and then the users are presented ads. I am assuming these adds are placed in their own cells of a UICollectionViewController. How does one add such ads to ones app in a randomly inserted cell between two existing cells without replacing either of them?

example

JuFa512
  • 119
  • 7
  • It's just you add your target ad count with actual content in your table view or collection view and fill them in at specific parts. It's not replacing them in any way. – tanmoy Jun 20 '22 at 17:28
  • not entirely sure I understand what you mean.. – JuFa512 Jun 20 '22 at 22:46
  • It's just that the backend would be sending you the response in such a way that datasource would have the cell type as ad and based on that the cells would be created. Just that you don't hardcode the rows to be displayed. It should be dynamic and depend on the response you get from backend. – Deepa Bhat Jun 27 '22 at 04:49

1 Answers1

-1

I have found a solution. Its not pretty but here it goes:

I have changed the height of every 5th cell to have space for implementing ads. Therefore I am not overwriting an already existing cell only populating an already existing cell with more data.

Once I have found a better solution I will let you know but this is it for now, if anyone comes across the same problem

JuFa512
  • 119
  • 7