I was using CollectionViewController all along without any lay outing issues.
After implementing SplitViewController for CollectionViewController... I noticed when I toggle switch for SplitViewController gap between two cells breaks or layouting of Cell i.e. sizeForItemAt
I have implemented multitasking - view for my app. i.e. if traitCollection.verticalSizeClass == .regular && traitCollection.horizontalSizeClass == .regular etc.
How to fix this?