title: UICollectionView custom layout
body: <p>I wanted to implement a UI like the one in appstore application in iphone. The UI looks quite complex with many moving parts in it.Below, is the screenshot of the application.</p>
  
  <p><img src="https://i.stack.imgur.com/DPAl9.png" alt="enter image description here"></p>
  
  <p>The view has three rows of cells. Each of those rows contains few other view which can be scrolled. I tried to implement this first using UITableView. So, I created a custom cell and realized that I had to add scrollview to each cell. I added the scrollview but again I had to add other view on the top of the scroll view. Again, I created nib and then created views dynamically and added on the cell, but this gives really poor performance. The UI lags very often, I know it is because of instantiating the custom view and adding to the scrollview everytime.</p>
  
  <p>Then, I tried to do the same thing with UICollectionView. I subclassed the UICollectionViewFlowLayout class. But, I had no clues on how to achieve this. This seems very interesting to me. If anybody could give me a clue, I would try to implement this myself. I dont think the tableview way is the good way to go but collection view could be a better solution in my opinion. I would really appreciate all those people who always try to make the world better by making other better, teaching and let people grow. ;)</p>