swiftxcodexcode-template

How to change the header comment for swift file


Custom the header comment for every project.

I created a plist file called IDETemplateMacros.plist and it's custom the header comment for all project but I need custom header for specific project, not for all the project and revert the custom text macro to default.

//
//  CategoryViewController.swift
//  ToDoey
//
//  Created by Swetha on 28/01/19.
//  Copyright © 2019 Swetha. All rights reserved.
//

to

//Hey..CategoryViewController.swift

I deleted the IDETemplateMacros.plist but it doesn't revert the text macro to default.

I expect the default text macro.


Solution

  • You can override the text macros globally, or for an individual workspace or project. You can also decide to keep the macros for a single user or share it for all users.

    The full list of locations that Xcode searches, in order of priority:


    In case you can't find the template file, you can make one with the name IDETemplateMacros.plist and this default content using textMacros:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
        <key>FILEHEADER</key>
        <string>
    //  ___FILENAME___
    //  ___PACKAGENAME___
    //
    //  Created by ___FULLUSERNAME___ on ___DATE___.
    //  ___COPYRIGHT___
    //
    </string>
        <key>FULLUSERNAME</key>
        <string>ENTER-YOUR-NAME-HERE</string>
    </dict>
    </plist>