title: UICollectionViewCell with flexible width
body: <p>I have a basic collection view with vertical scrolling, sections and variable amount of cells in each section. I need to adjust the width of each cell to fill available width of the view up to 4 cells, when I need to start next row of cells.</p>
  
  <p>If a section has 1, 2, 3 or 4 cells, their width should be 1/1, 1/2, 1/3 or 1/4 of the view's width respectively. Sections with more then 4 cells should stretch 4 cells in one row and continue on the other row.</p>
  
  <p>Do I need to subclass UICollectionViewFlowLayout for this or can I handle it in UICollectionViewController class and how?</p>
  
  <p><img src="https://i.stack.imgur.com/Ggdvo.png" alt="enter image description here"></p>