Populating Projects
You can add files of various formats to your project and organize them in groups. Use available AppCode or Xcode templates to create files with minimum efforts.
If necessary, you can also add empty files, create new file templates and file types.
Create files
AppCode provides file templates for most of the languages that it supports. This lets you create files with the initial content appropriate for the file purpose. For example, there are file templates for Swift types and Objective-C classes, JavaScript files, XSLT style sheets, and so on. Moreover, you can use all default Xcode templates for creating files in AppCode.
Generally, the filename extension for a template-based file is set automatically, so you don't need to specify it. However, if there are several extensions allowed for the file type, you will be able to choose one. For example, when creating a new class, you will be able to choose between .m extension for Objective-C class and .mm extension for Objective-C++ class.
Create a file from an AppCode template
Do one of the following:
In the Project tool window ⌥ 1, select the group in which you want to create a new file, and then choose from the main menu.
Right-click the corresponding group and select New from the context menu.
Press ⌘ N.
Select the desired file type from the list.
In the dialog that opens, type the filename (without extension) in the corresponding field.
Depending on the selected template, the dialog includes various options. For example, for code files, you can select location, group, and targets.
Specify other information as required. For example, you may be asked to define the values of custom variables if the corresponding file template contains such variables and their values are not currently set.
Create a file from an Xcode template
From the main menu, choose Project tool window ⌥ 1 right-click a group and select File from Xcode Template.
. Alternatively, in theIn the dialog that opens, select a file type on the left pane. On the right pane, choose a template:
Click Next to continue.
Specify the filename and location for the new file. You can use the default location selected in the Location field or specify another one. Choose the desired group and target and click Finish.
Create an empty file
Do one of the following:
In the Project tool window ⌥ 1, select the group in which you want to create a new file, and then choose from the main menu.
Right-click the corresponding group and select New from the context menu.
Press ⌘ N.
In the Create New File dialog, type the filename and extension. Optionally, you can change the location of the file on the disk, the group where to add it, and the targets.
Click OK.
Create groups
A group is an Xcode project model concept. Groups created with AppCode are fully compatible with Xcode.
Groups allow bringing order to the project files and this is their only purpose. You can arrange project items in any way you like. For example, you can organize Model, View, and Controller classes in a separate group or create a group hierarchy for tests.
A group is shown in the Project tool window ⌥ 1 and on the Navigation bar with the folder icon (if it has an underlying folder) or with the light folder icon (if there is no underlying folder).
Create a group
In the Project tool window ⌥ 1, select the destination directory node.
Right-click the selection or press ⌘ N to invoke the context menu, and then choose
.In the New Group dialog specify the group name. By default, AppCode creates underlying directory for the group to keep the group and directory structure synchronized. If necessary, you can create a group without this directory. To do so, clear the Create folder checkbox.
Click OK. As soon as the group appears in the Project tool window, you can drag files and groups into it.
Create a group from selection
In the Project tool window ⌥ 1, select several items (files and/or groups) by clicking them with Ctrl pressed.
Right-click the selection or press ⌘ N to invoke the context menu, and then choose
. Note that all selected items should be on the same level of the project hierarchy.In the New Group dialog, specify the group name and click OK.
Create folder references
As opposed to groups in AppCode, folder references are physical structures. The folder references allow you to organize your files into folders on your file system keeping the same folder structure in AppCode. Therefore, you can manage your asset files from outside of the IDE.
Use that folders as a storage place for project resources that do not need to be compiled (for example, icons). The IDE doesn't consider the source files in such folders as a part of a project.
Create a folder reference
In the Project tool window ⌥ 1, select the desired group.
Right-click the selection or press ⌘ N to invoke the context menu, and then choose
.In the New Folder Reference dialog, specify the folder name. You can also change the group and target here if required.
Click OK to create the folder reference and respective physical folder.