After selecting cell from viewDidLoad Layout is change

**Before select cell**

![Before select cell](https://i.stack.imgur.com/DXA2v.jpg)

**After select cell**

```
let indexPath = IndexPath(row: SelectedFolderIndex, section: 0)       
collectionView.selectItem(at: indexPath, animated: false, scrollPosition: .centeredVertically)

```

![After select cell](https://i.stack.imgur.com/l0Vuu.jpg)

**Layout**

```
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
    return CGSize(width: collectionView.frame.width/2.2, height: 55)
}

```

**ViewDidLoad**

```
let layout: UICollectionViewFlowLayout = UICollectionViewFlowLayout()
layout.sectionInset = UIEdgeInsets(top: 7, left: 12, bottom: 12, right: 12)
layout.minimumInteritemSpacing = 5
layout.minimumLineSpacing = 11
collectionView!.collectionViewLayout = layout
collectionView.delegate = self
collectionView.dataSource = self
collectionView.allowsMultipleSelection = false

```