my app, which loads plugins, has just stopped loading my test plugin.
I am dumbfounded by this issue. I will tell you what is going wrong. and I will tell you what was the very last thing I did. They are related but there is no reason to think that I have done anythign to cause this problem.
what is not going right:
I find my plugin, which is a bundle, and I try to load the principle class:
let aBundle = Bundle(url: anItem)
if let cls = aBundle?.principalClass as? CNPluginController.Type {
let plugin = cls.init()
plugins += [plugin]
}
until about 20 minutes ago, for nearly a year, this code has worked.
the if let line, is now failing. So the bundle is found (I can see that in the debugger) but the principle class is not a CNPluginController class.
now, as I said, I have just about an entire year of this code working. I wasn't mucking around in it. But... CNPluginController is defined in a framework, that is imported in both my app and the plugin. the framework is embedded as necessary, and it too hasn't seen any changes in months.
what was I doing when my app just failed to load plugins?
I created 2 new Swift files, in that plugin, and moved the code for 2 classes from a pre-existing file into those new files.
these files are part of the plugin's target, they do not under any circumstances conflict with the principle class, and yes... they are literally code that we already know: works just fine in the plugin.
I am mystified. I cannot account for this issue. My best guess is that the plugin has lost track of it's principle class type. But... it's clearly set in the info.plist, and I've cleaned the build folder now a half a dozen times.
any ideas welcome.