I want to change the default header in my Swift Package. Is this possible?
Note: I don't want to change it for a project. This is possible. If you want to change it for your Project: Changing the default header comment license in Xcode
To change the header comment for a single Swift Package, you will have to put your IDETemplateMacros.plist
file in the following location, relative to your package root :
.swiftpm/xcode/package.xcworkspace/xcshareddata/IDETemplateMacros.plist
Unfortunately, in Xcode 13, the package name macro won't work, but you can just specify it manually. Here's an example content for your macros file:
<?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___
// Your Package Name
//
// Created by ___FULLUSERNAME___ on ___DATE___.
// Copyright © 2021 Your Name Or Company. All rights reserved.
//</string>
</dict>
</plist>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With