I have a UICollectionView with random cells. Is there any method that allows me to center rows?

This is how it looks by default:

[ x x x x x x ]  
[ x x x x x x ]  
[ x x         ]  

Here is what the desired layout looks like:

[ x x x x x ]  
[ x x x x x ]  
[    x x    ]  
Edit
Report