Add new templates in Xcode

2019-02-09 04:46发布

How to add new templates in Xcode for iPhone application developement?

7条回答
Root(大扎)
2楼-- · 2019-02-09 05:52

From my answer to this question:

XCode uses template files for file and project templates and does variable expansion in both at creation time.

XCode 3.0-3.1 templates can be found in [Dev Installation]/Library/Xcode/, likely /Developer/Library/XCode. If you want to modify these templates or add your own, use the following directories to save your new/modified templates so that they are not wiped out by future Developer Tool upgrades:

  • File templates: ~/Library/Developer/Shared/Xcode/File Templates/
  • Target templates: ~/Library/Developer/Shared/Xcode/Target Templates/
  • Project templates: ~/Library/Developer/Shared/Xcode/Project Templates/

I think that you can also use the /Library/Developer/Shared/Xcode/[File|Target|Project] Templates/ directory for templates shared by all users.

A good tutorial on writing file templates is here [MacResearch.org].

查看更多
登录 后发表回答