2

I have created a IDETemplateMacros.plist with the following

<?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> ___COPYRIGHT___</string>
</dict>
</plist>

I have placed this at /Users/<User>/Library/Developer/Xcode/UserData/IDETemplateMacros.plist. This works well for xcode projects that I run/build from a .xcodeproj.

Unfortunately, I also work on a library which doesn't have an associated .xcodeproj and is only built and tested but never compiled. When I create new files in that project, it seems like xcode recognizes that it shouldn't use the standard header -- but instead of using the above, it only includes at the top an empty comment line:

//

Any thoughts on how to get this macro working in developing libraries locally which don't have .xcodeproj's associated to them?

Running Xcode 13.1

EndersJeesh
  • 427
  • 1
  • 4
  • 20

1 Answers1

0

After having the same issue, I've figured out the problem, at least when using CocoaPods.

The problem is that ___COPYRIGHT___ isn't set on the pods, so after a bit of googling I found this: Set Organization and Class Prefix with Podfile

So the fix for me was to add this to my Podfile:

post_install do |installer|
    installer.pods_project.root_object.attributes["ORGANIZATIONNAME"] = "My Company Name"
end

Obviously you need to replace "My Company Name" with your actual company name.

Hope this helps.

kaylanx
  • 908
  • 1
  • 8
  • 11