Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the Xcode solution organisation best practices and guidelines?

Are there any best practices for how to organise one's solution in xcode

This is mine at the moment from the root:

  • A folder for each 3rd party framework e.g. KissXML
  • A folder for my unit tests
  • A folder for frameworks, products and resources
  • A folder for MyApp which has sub folders for model, view, controller, database, supporting files and domain.
like image 412
TheLearner Avatar asked Mar 15 '12 09:03

TheLearner


People also ask

What is Xcode Organizer?

The Xcode Organizer Window allows you to track aggregated battery, performance, and IO metrics for your applications.

What are schemes in Xcode?

An Xcode scheme defines a collection of targets to build, a configuration to use when building, and a collection of tests to execute.

What is project Navigator in Xcode?

The Project navigator displays your project's files and lets you open, add, delete, and rearrange those files. To open the Project navigator, at the top of your project window's navigator area, click the icon that resembles a file folder.


1 Answers

Mine is:

Main application
    Model
    Singletons
    Helper+managers
    Controllers    // I keep nibs with their respective class files
    View
    Resources
        images
        plists
        //  ... groups from other types of resources if needed
    Supporting files
Unit tests
Frameworks

For reusable code on iOS I use static libraries and add these as separate projects in the Xcode workspace. Even for third-party code, if there is not a static library target, I create one. That way, I treat third-party code the same way as I treat my own library code. Further, then I don't have to worry about versioning of third-party code.

I've found it important to have Xcode mirror the file system organization of the code, at least up to some level. I adopted this practice after reading this blog post. I don't do this below the levels I've listed above, though. This helps when you share code on github, for example. Rather than have downloaders or contributors have to dig through all of your source dumped into a single directory, it is organized into functional buckets. I've seen some projects where the Xcode organization is OK, but every single source file in the file system is dumped into a single directory.

like image 194
FluffulousChimp Avatar answered Oct 31 '22 20:10

FluffulousChimp