Add new templates in Xcode

前端 未结 5 1789
温柔的废话
温柔的废话 2020-12-31 10:03

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

5条回答
  •  有刺的猬
    2020-12-31 10:56

    You can make a template through changing the contents of the developer folder. I have done this myself. Let's say, you were making an html template: Step 1. Go to:/Developer/Library/Xcode/Templates/file templates/resource Step 2. make a folder there called HTML File.xctemplate. Step 3. Copy the contents of the RTF file folder Step 4. Paste the contents in your html folder. Step 5. Change the rtf extention of the

    ___FILEBASENAME___.rtf(in your html folder) to .html
    

    Step 6. Change the plist file to:

    Key                       |         Type   |     Value
    DefaultCompletionName            String          File
    Description                      String         An empty Hyper Text Markup language (HTML) file.
    Kind                             String         Xcode.IDEKit.TextSubstitutionFileTemplateKind
    MainTemplateFile                 String         ___FILEBASENAME___.html
    Name                             String         Hyper Text Markup Language file
    Summary                          String         An empty Hyper Text Markup Language (HTML) file
    

    Step 7. now, when you add a new file, if you go to resources, you will find an html template. PS You just need to replace the html text to your choice, such as ruby.

提交回复
热议问题