Skip to content

Instantly share code, notes, and snippets.

@backviet
Last active October 20, 2018 02:39
Show Gist options
  • Save backviet/c71c1a210a430f11d0315f0b073506d3 to your computer and use it in GitHub Desktop.
Save backviet/c71c1a210a430f11d0315f0b073506d3 to your computer and use it in GitHub Desktop.
Xcode FILEHEADER template
<?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___
//
// Created by ___FULLUSERNAME___ on ___DATE___.
// Copyright (C) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved.
// </string>
</dict>
</plist>
@backviet
Copy link
Author

backviet commented Oct 20, 2018

Usage:
Helper link: https://help.apple.com/xcode/mac/9.0/index.html?localePath=en.lproj#/dev91a7a31fc

Text macros are symbols that are expanded in-place to the specified text. They are used in files and other places in Xcode, such as the header text for a new file or the project name. You can customize existing macros and add your own macros in a project, for all users of a project, or for all of Xcode. Customizing a macro requires two things:

A plist named IDETemplateMacros.plist at an appropriate location.
An entry in IDETemplateMacros.plist for the text macro.
Xcode looks for the value of a text macro in the following locations and uses the first matching macro:
Project user data: .xcodeproj/xcuserdata/[username].xcuserdatad/IDETemplateMacros.plist
Project shared data: .xcodeproj/xcshareddata/IDETemplateMacros.plist
Workspace user data: .xcworkspace/xcuserdata/[username].xcuserdatad/IDETemplateMacros.plist.
Workspace shared data: .xcworkspace/xcshareddata/IDETemplateMacros.plist
User Xcode data: ~/Library/Developer/Xcode/UserData/IDETemplateMacros.plist

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