Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do You structure an iPhone Xcode project?

What are good ways of building groups/folders?

I've tried by feature (UI for a feature plus model etc) with a common group. I've also tried by UI, model, etc.

The former keeps like things together which fits the iPhone paradigm nicely. The latter means I jump around a bit more.

What do you think?

like image 657
Scott McKenzie Avatar asked Oct 20 '10 23:10

Scott McKenzie


People also ask

How do I run an Xcode project on my iPhone?

Open up a project in Xcode and click on the device near the Run ▶ button at the top left of your Xcode screen. Plug your iPhone into your computer. You can select your device from the top of the list. Unlock your device and (⌘R) run the application.


2 Answers

The standard Xcode MVC folder structure is as follows.

  1. CoreData : Contains DataModel and Entity Classes.

  2. Extension : Contain One class(default apple class extensions+project class extensions.)

  3. Helper: Contain Third Party classes/Frameworks (eg. SWRevealController) + Bridging classes (eg. Obj C class in Swift based project)

  4. Model : Make a singleton class (eg.AppModel - NSArray,NSDictionary, String etc.) for saving data. The Web Service Response parsing and storing data is also done here.

  5. Services : Contain Web Service processes (eg. Login Verification, HTTP Request/Response)

  6. View : Contain storyboard, LaunchScreen.XIB and View Classes. Make a sub folder Cells - contain UITableViewCell, UICollectionViewCell etc.

  7. Controller: Contain Logic or Code related to UIElements (eg. UIButton’s reference+ clicked action)

like image 64
Alvin George Avatar answered Oct 02 '22 07:10

Alvin George


It's going to be very project dependent. In my last project I had mostly views, and so I organized the views by view-type.

like image 35
John Smith Avatar answered Oct 02 '22 07:10

John Smith