Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Possible to structure iOS app folder in Xcode?

Tags:

xcode

ios

I wonder if it's possible to structure my app's folder?

Right now I have every file under the root folder.

Can I make a new folder inside that one called VC and put all my VC files in it? Is there anything else I have to remember when if I reorganise my app files? eg file paths etc

like image 369
Kiwo Tew Avatar asked Oct 23 '15 11:10

Kiwo Tew


People also ask

How do I create a folder in Xcode?

You can create a new group, with its own folder, directly in Xcode, but it's not at all obvious. Instead of choosing 'New Group', choose 'Add Files to “<Project>”'. Then, in the file picker dialog, click the New Folder button or press Command-Shift-N and type the name of the new folder/group.

How do I import a folder into an Xcode project?

In the Choose a project pane, choose the Browse button to select an Xcode . pbxproj file. Navigate to the project file in the Select Xcode project file dialog, and then choose Open. In the Import from Xcode wizard, choose Next.

What is a group in Xcode?

A group in Xcode is a "fake" folder which does NOT represent a folder in the file system. It is common to use a combination of groups and folders for a given Xcode project. Follow this answer to receive notifications.


2 Answers

You can very well do that and in fact it is a good practice to organise your Xcode project navigator in similar folder structure as you have in your file system; it really helps.

All you need to do is to right click on your project file name in project navigator and select New Group.

enter image description here

This should then look like:

enter image description here

And then re-name it to whatever you want. You can then put your files in the correct group based on relevance. I would also advise to add them in similar folder in filesystem.

This is how it look like for me:

enter image description here

PS: You do not need to remember anything like file path etc. Xcode does that for you once you link your file in your target.

like image 135
Abhinav Avatar answered Sep 23 '22 21:09

Abhinav


YES you can do it by following this way :

1) open your folder project

2 ) create new folder by name VC

3 ) open xcode

4 ) drag and drop your vc folder to left side bar

5 ) check create group folder

6 ) uncheck copy .....

7 ) put your view controller on this folder

like image 41
Mo Farhand Avatar answered Sep 20 '22 21:09

Mo Farhand