3

I'm coming to iOS development from a web dev background.

Having all of my view controllers, data models and storyboards in the same directory is a real mess.

Are there any conventions for organising files within a project?

If not, are there any good reasons why I shouldn't do so like:

my_project/
  view_controllers/
  data_models/
  views/
  assets/
  tests/

All advice appreciated

bodacious
  • 6,608
  • 9
  • 45
  • 74

1 Answers1

3

There's no conventions (that I know of at least), it just comes down to what you feel move comfortable with. I use a similar kind of structure to you though along these lines:

MyProject/
  Source/
    Controller/
    Model/
    View/
    External/
      JoeRandomLibrary/
  Resources/
    Graphics/
    Interfaces/

I find that lays things out quite nicely. I then replicate that structure to that on disk as well.

mattjgalloway
  • 34,792
  • 12
  • 100
  • 110
  • I see you haven't included tests here... how common is unit testing in the iOS world? – bodacious Feb 10 '12 at 14:58
  • @bodacious A great question! I don't tend to unit test probably as much as I should, to be honest. I sometimes do but find user testing is much better in my experience. There's lots of questions about it though on here, e.g. http://stackoverflow.com/questions/8621617/unit-testing-for-the-app-store – mattjgalloway Feb 10 '12 at 15:05
  • Interesting... but also a load off my mind for now - I'm usually quite strict with TDD but can't even think where I'd start in iOS – bodacious Feb 10 '12 at 15:33