Skip to content

Instantly share code, notes, and snippets.

@harrisonrw
Created December 2, 2024 19:56
Show Gist options
  • Save harrisonrw/1c506bc24e969c43d570c58dbb2348d9 to your computer and use it in GitHub Desktop.
Save harrisonrw/1c506bc24e969c43d570c58dbb2348d9 to your computer and use it in GitHub Desktop.
Custom Xcode File Header
<?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___
// ___PROJECTNAME___
//
// Copyright © 2024 RWH Technology, LLC. All rights reserved.
//</string>
</dict>
</plist>
@harrisonrw
Copy link
Author

harrisonrw commented Dec 2, 2024

Example of Output

//
//  MyFile.swift
//  MyProject
//
//  Copyright © 2024 RWH Technology, LLC. All rights reserved.
//

Instructions

Create an IDETemplateMacros.plist file. Add a key for FILEHEADER. Put your customizations between the <string> and </string> tags.

See the Apple documentation for available text macros:
https://help.apple.com/xcode/mac/9.0/index.html?localePath=en.lproj#/dev7fe737ce0

Put the IDETemplateMacros.plist file in one of the locations described below.

Single project, single user

[PROJECTNAME].xcodeproj/xcuserdata/[USERNAME].xcuserdatad/IDETemplateMacros.plist

Single project, shared with team

[PROJECTNAME].xcodeproj/xcshareddata/IDETemplateMacros.plist

Workspace, single user

[WORKSPACENAME].xcworkspace/xcuserdata/[USERNAME].xcuserdatad/IDETemplateMacros.plist

Workspace, shared with team

[WORKSPACENAME].xcworkspace/xcshareddata/IDETemplateMacros.plist

For all projects (including projects in workspaces) on your system

~/Library/Developer/Xcode/UserData/IDETemplateMacros.plist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment