Change templates in Xcode

2019-01-01 08:20发布

How would I change the initial templates created by Xcode when creating a new Cocoa Class.

I am referring to the comments and class name created when using Xcode's new class wizard.

10条回答
余生无你
2楼-- · 2019-01-01 08:50

As of Xcode 7

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

For example if I place a Empty Application.xctemplate in ~/Library/Developer/Xcode/Templates/Project Templates/Application

It will appear in the template dialog as Template Dialog

查看更多
与君花间醉酒
3楼-- · 2019-01-01 08:51

In Xcode 4 and Xcode 5 the user file templates can be placed at:
~/Library/Developer/Xcode/Templates/[Category]

[Category] can be used to categorize your templates (choose a name of your choise)

If the folder doesn't exist already, create it!

查看更多
唯独是你
4楼-- · 2019-01-01 08:52

In XCode 4.5 right click on project, click Show File Inspector, then change Organization name in the file inspector's second tab (Project Document group)

查看更多
梦寄多情
5楼-- · 2019-01-01 08:56

Right click on xCode and select Show Package contents, then go to contents/Developer/Library/Xcode/Templates. Here you can find the templates for all programming languages.

Here some visualization:


enter image description here


enter image description here

查看更多
登录 后发表回答