UICollectionView

I have 12 cells in a collection view.

I am trying to find Swift code to make it display (4 rows x 3 columns) when the device is portrait, and then (2 rows by 6 columns) when in landscape.

I need each cell to evenly layout within the view and to fill it.

UICollectionView
 
 
Q