Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

please help me understand basic Xcode project setup

hi please can someone tell be in basic terms, what is the basic setup when creating a swift project in Xcode.

I've learnt a lot of swift over the past year and watched build a simple app etc but I'm just trying to get my head around the whole concept of where to put what parts in Xcode when creating an app.

for example do we store classes and their methods in one folder, properties in another, then structs and enums in another folder then call them in the main storyboard ?.

i just need a very basic idea of how this is all setup.

really appreciate any help thanks

Hi Jon, this is a big question, I'll give you a couple of tips...

  1. they way your classes in your app are stored depends on if your using objective c or swift. -example: in obj-c classes are made into their own cocoa class file where as in swift you can make many classes within one file. folders are optional and for your benefit so far as i know.
  2. if your using object you have a header file and main file, or .h & .M they for together...
    • when in objective c you must import the .h file or class file if you want to use the attributes from it example:
      • in swift your mainly just importing frameworks that you need very deep embedded code, like Foundation, UIKit, so on and so forth... but in obj-c you have to import your .h files like #import "Tower.h"
  3. You know about MVC so with swift you edit different views you make with a view controller file, and your "Model" or data base code can live in another file.

Hope this helps a little but at the end of the day playing around doing projects and rematching these videos will help

Thank you Harold