title: Collectionview grid with rounded corners at each corner of the grid
body: <p>I am trying to implement a simple <strong>grid of small rectangular cells separated by a grey line</strong>. Also, the <strong>four corners</strong> of my collection view should have <strong>rounded corners</strong>.</p>
  
  <p>I found that I can't just set the <strong><code>cornerRadius</code></strong> on the <strong><code>UICollectionView</code></strong> layer as that puts the whole <code>collectionview</code> in a 'box' and it looks weird whilst scrolling etc. It looks like I have to round the corner of the 4 cells at each corners.</p>
  
  <p>I ran into the challenges of</p>
  
  <ol>
  <li>Setting the rounded corner on the 4 corner cells WHILST</li>
  <li>Setting the actual borders in between the cells</li>
  </ol>
  
  <p>I would be grateful for some pointers. I managed to do it but using graphics for the top, bottom, left and right borders as well as to simulate the rounded edges. And this works for me as my grid has fixed values so I could calculate and work out for each cell what their position was in the grid. </p>
  
  <p>Thanks!</p>