I tried to create MVVM Template to creating file(s) (not project).
I want to add group (yellow folder) when I create the file, but I can't. When I created it, It create a folder (blue folder).
How can I achieve this?
I tried to use Node
and Definitions
but it still showing blue folder.
My MVVM.xctemplate hierarchy is like this:
-- (folder) FILEBASENAME FILEBASENAME
---- ___FILEBASENAME___ViewController.swift
--TemplateIcon.png
--TemplateInfo.plist
Here is my TemplateInfo.plist
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>Kind</key>
<string>Xcode.IDEFoundation.TextSubstitutionFileTemplateKind</string>
<key>Description</key>
<string>An empty MVVM Swift file.</string>
<key>Summary</key>
<string>An empty Swift MVVM file</string>
<key>AllowedTypes</key>
<array>
<string>public.swift-source</string>
</array>
<key>DefaultCompletionName</key>
<string>File</string>
<key>MainTemplateFile</key>
<string>___FILEBASENAME___.swift</string>
<key>Platforms</key>
<array>
<string>com.apple.platform.iphoneos</string>
</array>
<key>Options</key>
<array>
<dict>
<key>Identifier</key>
<string>productName</string>
<key>Required</key>
<true/>
<key>Name</key>
<string>Name:</string>
<key>Description</key>
<string>The name of the Navigator, ViewController and ViewModel to create</string>
<key>Type</key>
<string>text</string>
<key>Default</key>
<string>MyModel</string>
</dict>
</array>
<key>Definitions</key>
<dict>
<key>___FILEBASENAME___/___FILEBASENAME___ViewController.swift</key>
<dict>
<key>Group</key>
<array>
<string>___FILEBASENAME___</string>
</array>
<key>Path</key>
<string>___FILEBASENAME___/___FILEBASENAME___ViewController.swift</string>
<key>TargetIndices</key>
<array/>
</dict>
</dict>
<key>Nodes</key>
<array>
<string>___FILEBASENAME___/___FILEBASENAME___ViewController.swift</string>
</array>
</dict>
</plist>
Thank you.