dynamicType... ?

providing Codable support for a class. the class has an array that uses subclasses of the array's type. when you encode that sort of thing, you have to pull the array apart save individual arrays of each specific class, and then when you init that class, you will actually get the right Kind of type back.

it's a security thing. I get it.
but now... I have another wrinkle. the subclasses are going to be coming from plugins.

now I can't know in advance, what the total list of possible subclasses are.

what this all boils down to is:

I can ask a class what it's type is:
class.self
but can I capture that? I can't find the type for dynamicType.

I want to make an array of these types. I want to :
add a String Identifier to my plugin, and ask the plugin, for a string Identifier for the Type.
then I can save a dictionary of the subclasses, [String : [mySubClasses]]

the String would be : myPlugin.subClassHint

on Load, I should be able to cut up the string, I'll be able to find the plugin, and then ask for the type for that String...

but I need to be able to Set the return Type. dynamicType... doesn't work.

so, how do I refer to the dynamicType as a variable type? because... without it I've got no way to save data.
dynamicType... ?
 
 
Q