'Xcode template doesn't pick the variable from popup

I'm writing an XCode template. Everything works perfectly fine if I use text value for the variable:

        <dict>
        <key>Identifier</key>
        <string>appName</string>
        <key>Required</key>
        <string>true</string>
        <key>Name</key>
        <string>App name</string>
        <key>Description</key>
        <string>App name desc</string>
        <key>Type</key>
        <string>text</string>
        <key>NotPersisted</key>
        <string>true</string>
        </dict>

But it doesn't, if I use popup:

        <dict>
        <key>Identifier</key>
        <string>appName</string>
        <key>Required</key>
        <string>true</string>
        <key>Name</key>
        <string>App name</string>
        <key>Description</key>
        <string>App name desc</string>
        <key>Type</key>
        <string>popup</string>
        <key>NotPersisted</key>
        <string>true</string>
        <key>Values</key>
        <array>
            <string>AppX</string>
            <string>AppY</string>
        </array>
        </dict>

I'm accessing the variable like that:

class ___VARIABLE_appName:identifier___TestCase {}

Tried with:

___VARIABLE_appName:identifier___
___VARIABLE_appName___
___VARIABLE_appName:value___

and still nothing. I can of course just use text, but popup would be really better.



Solution 1:[1]

The solution for me was to create 2 folders (AppX and AppY) and store the duplicated templates inside them. The only thing that differs between these 2 files - is VARIABLE_appName - but by storing templates in different folders I remove the necessity to have it as a variable. So I hardcoded the value instead.

Instead of just Template1.swift I now have:

Folder AppX
   -Template1.swift
Folder AppY
   -Template2.swift

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 laechoppe