What's the best practice for naming Swift files that add extensions to existing objects?

后端 未结 7 661
面向向阳花
面向向阳花 2021-01-29 20:43

It\'s possible to add extensions to existing Swift object types using extensions, as described in the language specification.

As a result, it\'s possible to create exten

7条回答
  •  执笔经年
    2021-01-29 21:20

    I prefer StringExtensions.swift until I added too much things to split the file into something like String+utf8Data.swift and String+Encrypt.swift.

    One more thing, to combine similar files into one will make your building more faster. Refer to Optimizing-Swift-Build-Times

提交回复
热议问题