[swift-evolution] Extensions

Omar Charif omarchariffathi at icloud.com
Mon Jul 31 18:19:13 CDT 2017


I am a big fan of extensions, but I wonder what would happen years from now when we start to have lots of extensions created for the primitive classes. The problem is that we can write a String extension for example in any swift file in the project, the name of the file has nothing to do with the content of it. But for extensions … I think it is more ordered if we can see all Int extensions for example in same file. I don’t know how this could be done, maybe there is a way to even copy paste it automatically in a single file but for easier access I guess it would be nice to be able to find all extensions of a class in one place. You might not restrict it for anyone to write it in that single file, but you could automatically create a file for each class just to group all extensions of a class. Is that possible ?


More information about the swift-evolution mailing list