Xcode project template: add file to project group

How to create your own Xcode project template, add a file, for example README.md , to the project group (in the Project Navigator)?

The following steps put the README.md file in the root directory of the project (in the file system), but in the group named after the target. How to add it to the project group?

  • Add README.md to the root directory of the project template.

  • Add the following key-value pairs to TemplateInfo.plist .

     <key>Definitions</key> <dict> <key>../README.md</key> <dict> <key>Path</key> <string>README.md</string> <key>TargetIndices</key> <array/> </dict> </dict> 

    and

     <key>Nodes</key> <array> <string>../README.md</string> </array> 
+6
source share
1 answer
  • You can put the README.md file in the project template / folder_name
  • Add definitions to TemplateInfo.plist

     <key>FolderName/README.md</key> <dict> <key>Path</key> <string>FolderName/README.md</string> <key>Group</key> <array> <string>FolderName</string> </array> </dict> 

and

  1. add nodes

     <string>FolderName/README.md</string> 
0
source

All Articles