Custom Xcode 9+ file header template in order to be able to personalize the full username (author) on file creation.
Based on: https://oleb.net/blog/2017/07/xcode-9-text-macros/#text-macros-reference
You can also search "Customize text macros" in Xcode Help section for more official info.
-
Download IDETemplateMacros.plist file (or create a new one, see the link above)
-
Copy the IDETemplateMacros.plist on one of the following locations:
- Project user data: <ProjectName>.xcodeproj/xcuserdata/[username].xcuserdatad/IDETemplateMacros.plist.
- Project shared data: <ProjectName>.xcodeproj/xcshareddata/IDETemplateMacros.plist
- Workspace user data: <WorkspaceName>.xcworkspace/xcuserdata/[username].xcuserdatad/IDETemplateMacros.plist.
- Workspace shared data: <WorkspaceName>.xcworkspace/xcshareddata/IDETemplateMacros.plist.
- User Xcode data: ~/Library/Developer/Xcode/UserData/IDETemplateMacros.plist.
-
Edit CUSTOMFULLUSERNAME variable
-
Restart Xcode and create a new file with the new header
For this example, the file has been copied to User Xcode data. ~/Library/Developer/Xcode/UserData/IDETemplateMacros.plist.
The following template, when CUSTOMFULLUSERNAME = "epeuva"
// ___FILENAME___
// ___PRODUCTNAME___
//
// Created by ___CUSTOMFULLUSERNAME___ on ___DATE___
// ___COPYRIGHT___
//
generates:
//
// ViewController.h
// exampleProject
//
// Created by epeuva on 23/07/2018.
// Copyright © 2018 epeuva. All rights reserved.
//