Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Project Organization for a Modern Xcode App

Project Organization for a Modern Xcode App

It’s easy to just throw more targets at a project, but since Xcode 4 there have been nicer ways to organize your project and build settings for larger apps. This isn’t a deep dive into targets/workspaces/schemes (oh my, the pain!) but rather a simpler overview of using them all together to pull off some very common use-cases in modern projects.

9b54e5324785eb939bcc8f15c724baf9?s=128

Curtis Herbert

January 09, 2014
Tweet

Transcript

  1. Project organization for a modern Xcode app Curtis Herbert @parrots

  2. Simple beginnings

  3. Xcode 3 Build configurations, targets

  4. Xcode 4+ New: schemes and workspaces

  5. Target Apple: “Instructions for building one product”! Translation: A product/app/

    executable. • Which source files? • Build steps (link libraries, compile, copy resources, etc) • Build settings like provisioning profile, preprocessor macros • Executable information like name, ID, icons, etc
  6. None
  7. Build configuration Method to customize a target’s build settings #ifdef

    DEBUG For example: • Provisioning profile • App icon • App name • Bundle ID • Preprocessor macros
  8. None
  9. None
  10. When do you want another target? Two distinct apps with

    (some) shared code.! ! Test harness, for example. Isolate test code from normal builds.
  11. Scheme Apple: “Instructions for building targets and performing actions”! Translation:

    what to do when you build, run, archive, etc • Which target(s) to build? • Which build configuration? • Diagnostic flags like zombie objects, command-line arguments
  12. None
  13. One target The power of build configurations

  14. Demo

  15. Further reading WWDC 2011 - 313: Mastering schemes in Xcode

    4 ! “Unique icons for debug, beta, and App Store builds in Xcode 5” - http://blog.consumedbycode.com