Collection view generated codes are separated into multiple files.
First, a collection view is declared and setup in artboard generated file. The collection layout is configured and the collection view datasource is configured in this file too.
![](https://i0.wp.com/www.layoutcodeapp.com/wp-content/uploads/2022/05/collectionViewCreateLayout@2x.png?resize=995%2C660&ssl=1)
A separate file is used to hold the collection view datasource objects and its model.
![](https://i0.wp.com/www.layoutcodeapp.com/wp-content/uploads/2022/05/collectionViewDatasource@2x.png?resize=792%2C695&ssl=1)
For collection view cells, headers, footers and other supplementary views. Each cell view generate its own file.
![](https://i0.wp.com/www.layoutcodeapp.com/wp-content/uploads/2022/05/collectionViewCell@2x.png?resize=888%2C660&ssl=1)