How to support Xcode Templates for SwiftPM?

68 views Asked by At

I have Xcode Template that generate a bunch of files (not project) with some predefined repetitive code (for example classes for MVVM pattern). When I try to create these files in Xcode Project all works fine (I can find and create my templates in New File… menu), but when I try to do the same thing in SwiftPM I can't find my templates in the New File… menu.

All my templates are leaving in ~/Library/Developer/Xcode/Templates/**/*.xctemplate.

What should I do to show templates for SwiftPM as well?

1

There are 1 answers

0
pacification On BEST ANSWER

After some research of /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Templates/ folder I found that some default templates have the property SupportsSwiftPackage that set to YES. I added it to my templates and it finally works.

enter image description here