Too many swift file can affect build time?

I have some questions to apple team.

  • Too many swift file can make build time slow?
  • There is a large file like a kind of UIViewController. it confirms to a lot of protocol. like UICollectionViewDataSource, UICollectionViewDelegate and some one. Which one better? first, Just write it down one file or divide it into separated files to confirm each protocol.

Thanks!

A very big file is always bad as it is difficult to maintain if not properly structured. With Swift you can set protocol conformance in class/struct extensions and set store extension in different files. Making multiple files may enable preview/error auto search faster as the whole file does not need to be reabzlysed for each modification. BTW, when you build for archive for example, it is good to clean build folder before . I don’t think build time should be very different .

Too many swift file can affect build time?
 
 
Q