swiftxcodetemplatesswift-package-managerswift-package

Xcode 14: Custom templates don't appear in Swift Package file creation


I'm in a bit of a pickle. I created custom files templates for my Xcode projects.

In a normal project environment my custom templates appear when I access the New file creation popover as you can see in the following screenshoot

enter image description here

These templates are located at the common path of: /Users/XXXX/Library/Developer/Xcode/Templates

The problem appear when I'm working on a swift package. When I try to create a new file the popover interface is very different and does not contain my custom templates as seen with in the following image:

enter image description here

My suspicion is that I should set my templates in an other specific location for swift packages but I don't know where. I have looked around and I don't seems to find any reference to where I should set custom content for Swift Packages.

I'm looking for any tips on that matter. Or any information that could give me a some clues on how to fix my issue.

Thank you in advance.


Solution

  • Apparently there is a new field that needs to be set to make a template avaliable for the Swift Package

    Just add

    <key>SupportsSwiftPackage</key>
    <true/>
    

    to your TemplateInfo.plist

    enter image description here