How to create a centered UICollectionView like in Spotify's Player
<p>I am have a lot of difficulty trying to create a UICollectionView like in Spotify's Player that acts like this:</p>

<p><img src="https://media.giphy.com/media/l0NwH3XDSYhQ6l4TC/giphy.gif" alt="a busy cat"></p>

<p>The problem for me is two fold. </p>

<p>1) How do I center the cells so that you can see the middle cell as well as the one of the left and right.</p>

<ul>
<li>If I create cells that are square and add spacing between each cell, the cells are correctly displayed but are not centered. </li>
</ul>

<p>2) With pagingEnabled = YES, the collectionview correctly swipes from one page to another. However, without the cells being centered, it simply moves the collection view over a page which is the width of the screen. So the question is how do you make the pages move so you get the effect above.</p>

<p>3) how do you animate the size of the cells as they move</p>

<ul>
<li>I don't want to worry about this too much. If I can get that to work it would be great, but the harder problems are 1 and 2.</li>
</ul>

<p>The code I have currently is a simple UICollectionView with normal delegate setup and custom UICollectionview cells that are squares. Maybe I neeed to subclass UICollectionViewFlowLayout? Or maybe I need to turn pagingEnabled  to NO and then use custom swipe events? Would love any help!</p>