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

后端 未结 7 743
面向向阳花
面向向阳花 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:28

    I prefer having a + to underline the fact it contains extensions :

    String+Extensions.swift

    And if the file gets too big, you can then split it for each purpose :

    String+UTF8Data.swift

    String+Encrypt.swift

提交回复
热议问题