Esqarrouth/EZSwiftExtensions

Better project organisation

DominikBucher12 opened this issue · 5 comments

For now, it's just some files in one folder - how the heck can someone find the desired extension? I suggest Adding the Class+Extensions/Feature.swift convention to files or for example multiple files like UIView+ToImage, UIView+FadeAnimations etc. Now it's super complicated to find what you desire. I suggest to add Folder structure like this:

  • UIKit

    • UILabel
      • ULabel+EstimatedSize etc
  • Foundation

    • UserDefaults
      • UserDefaults+Date etc

Interesting thought. I do not particularly like the + convention, since that would bloat up the number of files based on the number of methods that are present. Instead a straightforward UIKit and Foundation split seems more appropriate.

Technically there are two facets to this problem. One is discovery by the user (application programmer who uses this). They wont have any marginal benefit, since they would most probably use their IDE's autocomplete anyways (Xcode, AppCode etc). The other is discoverability for the developer of the framework. In there I see the utility, but I would let the other maintainers chime in on the level of granularity we should have for our folder structure. @lfarah @goktugyil Any comments?

+1 truth the user won't have any benefit, but the developer could be clear. Also I guess it would be better to remove the Extension word from the files since it is obvious that these are Extensions from the name of project ^^

Good point. I will wait for one more maintainer to pitch in before making the changes.

I agree on @Khalian 's comments.

Where are you trying to find your desired extension from? Github or Xcode?

The extension keyword helps you differentiate from the original file, while using quick open etc.. But it could be shorter like: ext maybe?

Well, if you don't wanna have better organization and rely on jump to definition function in Xcode, I guess it is to keep the chaos as is. So I'll close this issue now. Merry Christmas!